# EventRoute

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

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

```rust
struct EventRoute
```

Holds the route for a routed event and supports raising an event on that
route.

The list of handlers is taken from a per-thread pool and returned to it
when the route is dropped (or disposed), so raising an
event does not allocate once the pool is warm.

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

## Members

- [`new`](#function-new)
- [`has_handlers`](#function-has_handlers)
- [`add`](#function-add)
- [`add_class_handler`](#function-add_class_handler)
- [`raise_event`](#function-raise_event)
- [`dispose`](#function-dispose)

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

### new

```rust
fn new<T: ?Sized>(e: &RoutedEvent<T>) -> Self
```

Creates a route for a routed event.

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

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

### has_handlers

```rust
fn has_handlers(self: &Self) -> bool
```

Whether the route has any handlers.

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

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

### add

```rust
fn add(self: &mut Self, target: &Ref<Interactive>, handler: RouteHandler, routes: RoutingStrategies, handled_events_too: bool)
```

Adds a handler to the route.

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

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

### add_class_handler

```rust
fn add_class_handler(self: &mut Self, target: &Ref<Interactive>)
```

Adds a class handler to the route: a marker that makes the class
handlers of the event run for `target`.

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

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

### raise_event

```rust
fn raise_event(self: &Self, source: &Ref<Interactive>, e: &dyn IRoutedEventArgs)
```

Raises an event along the route.

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

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

### dispose

```rust
fn dispose(self: &mut Self)
```

Releases the route's handler list back to the pool.

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

## 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`
- `Drop`

## Availability

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