# DispatcherFrame

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-base/threading/struct-dispatcherframe/

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

```rust
struct DispatcherFrame
```

Represents an execution loop in the [`Dispatcher`](/docs/0.5.0/api/ferroui-base/threading/struct-dispatcher/).

Frames are shared handles: `set_continue` can be
called from any thread.

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

## Members

- [`new`](#function-new)
- [`with_exit_when_requested`](#function-with_exit_when_requested)
- [`dispatcher`](#function-dispatcher)
- [`continue_`](#function-continue_)
- [`set_continue`](#function-set_continue)

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

### new

```rust
fn new() -> Arc<DispatcherFrame>
```

Constructs a new instance of the frame for the current dispatcher.
The frame exits when all frames are requested to exit.

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

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

### with_exit_when_requested

```rust
fn with_exit_when_requested(exit_when_requested: bool) -> Arc<DispatcherFrame>
```

Constructs a new instance of the frame for the current dispatcher.

`exit_when_requested` indicates whether or not this frame will exit
when all frames are requested to exit. Dispatcher frames typically
break down into two categories:

1. Long running, general purpose frames, that exit only when told to.
   These frames should exit when requested.
2. Short running, very specific frames that exit themselves when an
   important criteria is met. These frames may consider not exiting
   when requested in favor of waiting for their important criteria to
   be met. These frames should have a timeout associated with them.

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

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

### dispatcher

```rust
fn dispatcher(self: &Self) -> &Arc<Dispatcher>
```

The dispatcher this frame runs on.

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

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

### continue_

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

Indicates that this dispatcher frame should continue.

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

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

### set_continue

```rust
fn set_continue(self: &Self, value: bool)
```

Sets whether this dispatcher frame should continue. Setting it to
`false` exits the loop the frame is running.

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

## 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`

## Availability

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