# RoutedEventRegistry

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-base/interactivity/struct-routedeventregistry/

**struct** · [`ferroui-base`](/docs/0.5.0/api/ferroui-base/) · v0.5.0

```rust
struct RoutedEventRegistry
```

Tracks registered routed events.

Like routed event definitions, the registry is per-thread.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/interactivity/routed_event_registry.rs#L9)

## Members

- [`new`](#function-new)
- [`instance`](#function-instance)
- [`register`](#function-register)
- [`get_all_registered`](#function-get_all_registered)
- [`get_registered`](#function-get_registered)
- [`get_registered_for`](#function-get_registered_for)
- [`find_by_name`](#function-find_by_name)

<a id="function-new"></a>

### new

```rust
fn new() -> Self
```

Creates an empty registry.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/interactivity/routed_event_registry.rs#L21)

<a id="function-instance"></a>

### instance

```rust
fn instance() -> &'static RoutedEventRegistry
```

The routed event registry instance of the current thread.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/interactivity/routed_event_registry.rs#L26)

<a id="function-register"></a>

### register

```rust
fn register<T: ?Sized>(self: &Self, type_: &'static TypeInfo, event: RoutedEvent<T>)
```

Registers a routed event on a type.

You won't usually want to call this method directly: use
`RoutedEvent::register`, which calls it.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/interactivity/routed_event_registry.rs#L37)

<a id="function-get_all_registered"></a>

### get_all_registered

```rust
fn get_all_registered(self: &Self) -> Vec<RoutedEvent>
```

Returns all routed events registered with the registry.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/interactivity/routed_event_registry.rs#L42)

<a id="function-get_registered"></a>

### get_registered

```rust
fn get_registered(self: &Self, type_: &'static TypeInfo) -> Vec<RoutedEvent>
```

Returns the routed events registered on a type.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/interactivity/routed_event_registry.rs#L47)

<a id="function-get_registered_for"></a>

### get_registered_for

```rust
fn get_registered_for<TOwner: StaticType>(self: &Self) -> Vec<RoutedEvent>
```

Returns the routed events registered on class `TOwner`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/interactivity/routed_event_registry.rs#L52)

<a id="function-find_by_name"></a>

### find_by_name

```rust
fn find_by_name(self: &Self, owner: &'static TypeInfo, name: &str) -> Option<RoutedEvent>
```

Finds the routed event named `name` that `owner` or one of its base
classes registers, nearest class first: the lookup of the routed
event behind an event name of the managed original (the static
`<Name>Event` field of the class or of a base class, found by
reflection).

The comparison is case-sensitive. `name` is the name of the event
(`"Click"`) or of the field that holds it (`"ClickEvent"`): on each
class an event of exactly that name is preferred, then the name
without the `Event` suffix.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/interactivity/routed_event_registry.rs#L66)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `Borrow<T>`
- `BorrowMut<T>`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- `Any`
- `ErasedDestructor`
- `IntoEither`
- `Default`

## Availability

Extracted for `aarch64-apple-darwin`. Cargo features are listed in the [crate index](/docs/0.5.0/api/).
