# IDispatcher

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-base/threading/trait-idispatcher/

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

```rust
trait IDispatcher
```

Dispatches jobs to a thread.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/threading/i_dispatcher.rs#L4)

## Members

- [`check_access`](#function-check_access)
- [`verify_access`](#function-verify_access)
- [`post`](#function-post)

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

### check_access

```rust
fn check_access(self: &Self) -> bool
```

Determines whether the calling thread is the thread associated with
this dispatcher.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/threading/i_dispatcher.rs#L7)

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

### verify_access

```rust
fn verify_access(self: &Self)
```

Panics when the calling thread is not the thread associated with this
dispatcher.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/threading/i_dispatcher.rs#L11)

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

### post

```rust
fn post(self: &Self, action: Box<dyn FnOnce() -> () + Send>, priority: DispatcherPriority)
```

Posts an action that will be invoked on the dispatcher thread.

The action can be posted from any thread and therefore has to be
`Send`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/threading/i_dispatcher.rs#L17)

## Trait implementations

- [`IDispatcher`](/docs/0.5.0/api/ferroui-base/threading/trait-idispatcher/)

## Availability

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