# RoutedEventArgs

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

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

```rust
struct RoutedEventArgs
```

Provides state information and data specific to a routed event.

The routing state (`handled`, `route`, `source`) is mutated while the
event travels along its route, so it is interiorly mutable: handlers
receive the args by shared reference.

The args are a reference object: a copy shares the routing state with
the args it was made from (marking a copy as handled marks the event as
handled), and copies compare by identity. The same holds for the args
types derived from this one, whose own mutable state is shared too.

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

## Members

- [`new`](#function-new)
- [`with_event`](#function-with_event)
- [`with_event_and_source`](#function-with_event_and_source)
- [`handled`](#function-handled)
- [`set_handled`](#function-set_handled)
- [`routed_event`](#function-routed_event)
- [`set_routed_event`](#function-set_routed_event)
- [`route`](#function-route)
- [`set_route`](#function-set_route)
- [`source`](#function-source)
- [`set_source`](#function-set_source)
- [`is_source`](#function-is_source)

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

### new

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

Creates args with no routed event.

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

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

### with_event

```rust
fn with_event<T: ?Sized>(routed_event: &RoutedEvent<T>) -> Self
```

Creates args for a routed event.

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

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

### with_event_and_source

```rust
fn with_event_and_source<T: ?Sized>(routed_event: &RoutedEvent<T>, source: impl Into<Nullable<FerroObject>>) -> Self
```

Creates args for a routed event with a source.

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

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

### handled

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

Whether the routed event has already been handled.

Once handled, the event keeps travelling along its route but is only
delivered to handlers registered for handled events too.

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

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

### set_handled

```rust
fn set_handled(self: &Self, value: bool)
```

Marks the routed event as handled or unhandled.

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

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

### routed_event

```rust
fn routed_event(self: &Self) -> Option<RoutedEvent>
```

The routed event associated with these args.

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

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

### set_routed_event

```rust
fn set_routed_event<T: ?Sized>(self: &Self, value: Option<&RoutedEvent<T>>)
```

Sets the routed event associated with these args.

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

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

### route

```rust
fn route(self: &Self) -> RoutingStrategies
```

The routing strategy currently being applied to the event.

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

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

### set_route

```rust
fn set_route(self: &Self, value: RoutingStrategies)
```

Sets the routing strategy currently being applied to the event.

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

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

### source

```rust
fn source(self: &Self) -> Option<Ref<FerroObject>>
```

The object that raised the event.

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

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

### set_source

```rust
fn set_source(self: &Self, value: impl Into<Nullable<FerroObject>>)
```

Sets the object that raised the event.

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

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

### is_source

```rust
fn is_source(self: &Self, object: &FerroObject) -> bool
```

Whether `object` is the source of the event (C# `e.Source == object`).

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

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- [`PropertyValue`](/docs/0.5.0/api/ferroui-base/trait-propertyvalue/)
- [`AnyValue`](/docs/0.5.0/api/ferroui-base/trait-anyvalue/)
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `Borrow<T>`
- `BorrowMut<T>`
- `CloneToUninit`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- `Any`
- `ToOwned`
- `ErasedDestructor`
- `IntoEither`
- `Clone`
- `Default`
- `PartialEq`
- [`IRoutedEventArgs`](/docs/0.5.0/api/ferroui-base/interactivity/trait-iroutedeventargs/)

## Availability

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