# IEventPatternSource

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

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

```rust
trait IEventPatternSource<S, A>
```

An event that notifies the event patterns of a sequence as a sender and arguments
(`IEventPatternSource<TEventArgs>`), returned by `to_event_pattern`.

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

## Members

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

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

### add

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

Adds a handler of the events (`OnNext += handler`); returns the token that removes it.

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

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

### remove

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

Removes the handler of `token` (`OnNext -= handler`). False when the token is unknown.

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

## Availability

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