# RxState

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-reactiveui/struct-rxstate/

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

```rust
struct RxState
```

The state of ReactiveUI that its objects share (`RxState`): the handler of the errors that no
`thrown_exceptions` subscriber handles.

Deviation (DEVIATIONS.md, ReactiveUI): the state is per thread, as the objects that use it are
(`docs/porting/reactive.md`, section 5.1).

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

## Members

- [`default_exception_handler`](#function-default_exception_handler)
- [`initialize_exception_handler`](#function-initialize_exception_handler)

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

### default_exception_handler

```rust
fn default_exception_handler() -> Rc<dyn IObserver<ObservableError>>
```

The observer that receives the errors of the objects implementing
`IHandleObservableErrors` when nothing subscribes to
their `thrown_exceptions` (`DefaultExceptionHandler`).

Unless `initialize_exception_handler` set another
one first, it schedules on `RxSchedulers::main_thread_scheduler` a panic with an
`UnhandledError` that names the error, where upstream throws that exception.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI/rx_state.rs#L33)

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

### initialize_exception_handler

```rust
fn initialize_exception_handler(exception_handler: Rc<dyn IObserver<ObservableError>>)
```

Sets the handler of `default_exception_handler` unless
one was set or read before (`InitializeExceptionHandler`); the builder of the application
calls it.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI/rx_state.rs#L43)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- `Borrow<T>`
- `BorrowMut<T>`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- `Any`

## Availability

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