# BindingSchedulers

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-reactiveui/binding/bindings/struct-bindingschedulers/

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

```rust
struct BindingSchedulers
```

Where a binding delivers its writes to the view (`BindingSchedulers`).

A write is delivered at once on the thread that owns the object it lands on, and otherwise
through the [`IViewThreadInvoker`](/docs/0.5.0/api/ferroui-reactiveui/binding/interfaces/trait-iviewthreadinvoker/) that claims the object, or the scheduler the host set
(`set_main_thread`).

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI/binding/bindings/binding_schedulers.rs#L27)

## Members

- [`main_thread`](#function-main_thread)
- [`set_main_thread`](#function-set_main_thread)
- [`use_schedule`](#function-use_schedule)
- [`use_synchronization_context`](#function-use_synchronization_context)
- [`observe_on_view_thread`](#function-observe_on_view_thread)
- [`observe_on_view_thread_with_fallback`](#function-observe_on_view_thread_with_fallback)
- [`observe_on_sequencer`](#function-observe_on_sequencer)

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

### main_thread

```rust
fn main_thread() -> Option<Rc<dyn IScheduler>>
```

The scheduler a write that waits for the owning thread is delivered on, or `None` to use the
view's own dispatcher (the getter of `MainThread`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI/binding/bindings/binding_schedulers.rs#L32)

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

### set_main_thread

```rust
fn set_main_thread(scheduler: Option<Rc<dyn IScheduler>>)
```

Sets the scheduler a write that waits for the owning thread is delivered on, or `None` to
use the view's own dispatcher (the setter of `MainThread`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI/binding/bindings/binding_schedulers.rs#L38)

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

### use_schedule

```rust
fn use_schedule(schedule: Option<Arc<dyn Schedule>>)
```

Delivers the writes that wait for the owning thread through `schedule` (a dispatcher's
`task_schedule(priority)`), or through the view's own dispatcher when `schedule` is `None`
(`UseSynchronizationContext`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI/binding/bindings/binding_schedulers.rs#L46)

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

### use_synchronization_context

```rust
fn use_synchronization_context(context: Option<Arc<dyn ferroui_system::threading::SynchronizationContext>>)
```

Delivers the writes that wait for the owning thread through `context`, or through the
view's own dispatcher when `context` is `None` (`UseSynchronizationContext`).

> **Deprecated since 0.5.0.** use `BindingSchedulers::use_schedule` with a `ferroui_system::task::Schedule`

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI/binding/bindings/binding_schedulers.rs#L54)

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

### observe_on_view_thread

```rust
fn observe_on_view_thread<T: 'static>(source: Rc<dyn IObservable<T>>, target: Option<Rc<dyn Any>>) -> Rc<dyn IObservable<T>>
```

`source` routed onto the thread that owns `target`, the object the write lands on; the
source itself when `target` is `None` or no registered invoker claims it
(`ObserveOnViewThread<T>(IObservable<T>, object?)`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI/binding/bindings/binding_schedulers.rs#L61)

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

### observe_on_view_thread_with_fallback

```rust
fn observe_on_view_thread_with_fallback<T: 'static>(source: Rc<dyn IObservable<T>>, target: Option<Rc<dyn Any>>, fallback: Rc<dyn IViewThreadInvoker>) -> Rc<dyn IObservable<T>>
```

`observe_on_view_thread`, with `fallback`, the invoker of
the platform of `target`, used when no registered invoker claims it; the source itself when
`target` is `None` (`ObserveOnViewThread<T>(IObservable<T>, object?, IViewThreadInvoker)`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI/binding/bindings/binding_schedulers.rs#L69)

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

### observe_on_sequencer

```rust
fn observe_on_sequencer<T: 'static>(source: Rc<dyn IObservable<T>>, scheduler: Rc<dyn IScheduler>) -> Rc<dyn IObservable<T>>
```

`source` observed on `scheduler`, a newer value replacing one that has not been delivered
(`ObserveOnSequencer<T>`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI/binding/bindings/binding_schedulers.rs#L83)

## 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/).
