# ToEvent

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-reactiveui/binding/mixins/struct-toevent/

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

```rust
struct ToEvent<C>
```

The event of a control that executes a bound command (`string? toEvent`).

`ToEvent::event` names the event and reads it from the control, as upstream's source
generator resolves a literal event name at compile time: the command binds to it directly,
unless a registered binder has a higher affinity for the control than the binding to an event
(`BindingAffinity::DEFAULT_EVENT`). `ToEvent::named` only names it, and the registered
binder with the highest affinity for the control binds it
(`ICreatesCommandBinding::bind_command_to_object_event`).

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI/binding/mixins/reactive_ui_binding_extensions_bind_command.rs#L101)

## Members

- [`named`](#function-named)
- [`event`](#function-event)
- [`subscription`](#function-subscription)
- [`name`](#function-name)

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

### named

```rust
fn named(name: impl Into<String>) -> Self
```

The event named `name`, bound by a registered binder.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI/binding/mixins/reactive_ui_binding_extensions_bind_command.rs#L120)

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

### event

```rust
fn event<A: ?Sized + 'static>(name: impl Into<String>, event: fn(&C) -> &Event<A>) -> Self
```

The event named `name` that `event` reads from the control.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI/binding/mixins/reactive_ui_binding_extensions_bind_command.rs#L125)

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

### subscription

```rust
fn subscription(name: impl Into<String>, subscription: ControlEventSubscription<C>) -> Self
```

The event named `name` that `subscription` adds a handler to.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI/binding/mixins/reactive_ui_binding_extensions_bind_command.rs#L130)

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

### name

```rust
fn name(self: &Self) -> &str
```

The name of the event.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI/binding/mixins/reactive_ui_binding_extensions_bind_command.rs#L135)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- `Borrow<T>`
- `BorrowMut<T>`
- `CloneToUninit`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- `Any`
- `ToOwned`
- `Clone`
- `Debug`

## Availability

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