# IEventSource

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-reactive/linq/trait-ieventsource/

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

```rust
trait IEventSource<T>
```

An event that notifies the values of a sequence (`IEventSource<T>`), returned by `to_event`.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Reactive/linq/event_pattern.rs#L65)

## Members

- [`add`](#function-add)
- [`remove`](#function-remove)

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

### add

```rust
fn add(self: &Self, handler: Rc<dyn Fn(T) -> ()>) -> u64
```

Adds a handler of the values (`OnNext += handler`); returns the token that removes it. The
handler is subscribed to the sequence until it is removed or the sequence ends.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Reactive/linq/event_pattern.rs#L68)

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

### remove

```rust
fn remove(self: &Self, token: u64) -> bool
```

Removes the handler of `token` (`OnNext -= handler`) and disposes its subscription. False
when the token is unknown: removed already, or its subscription ended with the sequence.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Reactive/linq/event_pattern.rs#L72)

## Availability

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