# AnonymousObserver

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

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

```rust
struct AnonymousObserver<T>
```

An observer built from closures.

An observer without a closure for errors rethrows an error it is given
(it panics with the message of the error); one without a closure for
completion ignores it.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/reactive/anonymous_observer.rs#L9)

## Members

- [`new`](#function-new)
- [`new_with_error`](#function-new_with_error)
- [`new_with_completed`](#function-new_with_completed)
- [`new_with_error_and_completed`](#function-new_with_error_and_completed)
- [`with_error`](#function-with_error)
- [`with_completed`](#function-with_completed)

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

### new

```rust
fn new(on_next: impl Fn(T) -> () + 'static) -> Self
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/reactive/anonymous_observer.rs#L16)

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

### new_with_error

```rust
fn new_with_error(on_next: impl Fn(T) -> () + 'static, on_error: impl Fn(ObservableError) -> () + 'static) -> Self
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/reactive/anonymous_observer.rs#L24)

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

### new_with_completed

```rust
fn new_with_completed(on_next: impl Fn(T) -> () + 'static, on_completed: impl Fn() -> () + 'static) -> Self
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/reactive/anonymous_observer.rs#L28)

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

### new_with_error_and_completed

```rust
fn new_with_error_and_completed(on_next: impl Fn(T) -> () + 'static, on_error: impl Fn(ObservableError) -> () + 'static, on_completed: impl Fn() -> () + 'static) -> Self
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/reactive/anonymous_observer.rs#L32)

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

### with_error

```rust
fn with_error(self: Self, on_error: impl Fn(ObservableError) -> () + 'static) -> Self
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/reactive/anonymous_observer.rs#L40)

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

### with_completed

```rust
fn with_completed(self: Self, on_completed: impl Fn() -> () + 'static) -> Self
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/reactive/anonymous_observer.rs#L45)

## 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`
- [`IObserver<T>`](/docs/0.5.0/api/ferroui-base/reactive/use-iobserver/)

## Availability

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