# WeakEventSubscriber

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-base/utilities/struct-weakeventsubscriber/

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

```rust
struct WeakEventSubscriber<A: WeakEventArgs + ?Sized>
```

A subscriber that raises its `event` for every event it
receives.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/utilities/i_weak_event_subscriber.rs#L23)

## Members

- [`new`](#function-new)
- [`event`](#function-event)

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

### new

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



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/utilities/i_weak_event_subscriber.rs#L29)

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

### event

```rust
fn event<F>(self: &Self, handler: F) -> Rc<dyn IDisposable>
where F: Fn(Option<&'s dyn Any>, &'v dyn Any, &'r <A as >::Args<'a>) -> () + 'static
```

Subscribes to the events this subscriber receives. Disposing the
returned handle unsubscribes.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/utilities/i_weak_event_subscriber.rs#L35)

## 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`
- [`IWeakEventSubscriber<A>`](/docs/0.5.0/api/ferroui-base/utilities/trait-iweakeventsubscriber/)

## Availability

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