# IScheduler

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-reactive/concurrency/trait-ischeduler/

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

```rust
trait IScheduler
```

Schedules units of work (`IScheduler`).

Deviation (DEVIATIONS.md, Reactive): absolute times are `SystemTime` where upstream has
`DateTimeOffset`, and relative times `Duration` where upstream has `TimeSpan`. A `TimeSpan` may
be negative upstream and is normalized to zero by every scheduler (`Scheduler.Normalize`); a
`Duration` cannot be negative.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Reactive/concurrency/scheduler.rs#L28)

## Members

- [`now`](#function-now)
- [`schedule`](#function-schedule)
- [`schedule_after`](#function-schedule_after)
- [`schedule_at`](#function-schedule_at)
- [`as_periodic`](#function-as_periodic)
- [`as_stopwatch_provider`](#function-as_stopwatch_provider)
- [`cancellation_token`](#function-cancellation_token)

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

### now

```rust
fn now(self: &Self) -> SystemTime
```

The scheduler's notion of the current time.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Reactive/concurrency/scheduler.rs#L30)

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

### schedule

```rust
fn schedule(self: &Self, action: ScheduledAction) -> Rc<dyn IDisposable>
```

Schedules work to run as soon as possible.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Reactive/concurrency/scheduler.rs#L33)

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

### schedule_after

```rust
fn schedule_after(self: &Self, due_time: Duration, action: ScheduledAction) -> Rc<dyn IDisposable>
```

Schedules work to run after `due_time`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Reactive/concurrency/scheduler.rs#L36)

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

### schedule_at

```rust
fn schedule_at(self: &Self, due_time: SystemTime, action: ScheduledAction) -> Rc<dyn IDisposable>
```

Schedules work to run at `due_time`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Reactive/concurrency/scheduler.rs#L39)

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

### as_periodic

```rust
fn as_periodic(self: &Self) -> Option<&dyn ISchedulerPeriodic>
```

The periodic scheduling of the scheduler, if it has its own (`GetService(typeof(ISchedulerPeriodic))`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Reactive/concurrency/scheduler.rs#L42)

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

### as_stopwatch_provider

```rust
fn as_stopwatch_provider(self: &Self) -> Option<&dyn IStopwatchProvider>
```

The stopwatch of the scheduler, if it has its own (`GetService(typeof(IStopwatchProvider))`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Reactive/concurrency/scheduler.rs#L47)

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

### cancellation_token

```rust
fn cancellation_token(self: &Self) -> Option<CancellationToken>
```

The cancellation token of the scheduler that `SchedulerExt::schedule_async` hands its
body, which `SchedulerExt::yield_` and `SchedulerExt::sleep` without a token observe
(`GetCancellationToken`: `scheduler is CancelableScheduler cs ? cs.Token : None`); none for
any other scheduler.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Reactive/concurrency/scheduler.rs#L55)

## Trait implementations

- [`IScheduler`](/docs/0.5.0/api/ferroui-reactive/concurrency/trait-ischeduler/)

## Availability

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