# ObserverBase

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-reactive/struct-observerbase/

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

```rust
struct ObserverBase<T>
```

An observer that enforces the grammar of the notifications on its core (`ObserverBase<T>`):
values reach the core until a terminal notification; the first terminal notification reaches
it, and every notification after it is ignored. Disposing the observer stops it the same way.

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

## Members

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

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

### new

```rust
fn new(core: impl ObserverCore<T> + 'static) -> Self
```

An observer of the handlers of `core` (a subclass of `ObserverBase<T>` upstream).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Reactive/observer_base.rs#L55)

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

### from_fns

```rust
fn from_fns(on_next_core: impl Fn(T) -> () + 'static, on_error_core: impl Fn(ObservableError) -> () + 'static, on_completed_core: impl Fn() -> () + 'static) -> Self
```

An observer whose handlers are the three functions.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Reactive/observer_base.rs#L60)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- `Borrow<T>`
- `BorrowMut<T>`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- `Any`
- [`IObserver<T>`](/docs/0.5.0/api/ferroui-base/reactive/use-iobserver/)
- [`IDisposable`](/docs/0.5.0/api/ferroui-base/reactive/use-idisposable/)

## Availability

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