pub trait Schedule<M = ()>: Sealed<M> {
// Required method
fn schedule(&self, runnable: Runnable<M>, info: ScheduleInfo);
// Provided methods
fn begin_schedule(&self) { ... }
fn before_enqueue(&self) { ... }
fn end_schedule(&self) { ... }
}Expand description
The trait for scheduling functions.
Required Methods§
Sourcefn schedule(&self, runnable: Runnable<M>, info: ScheduleInfo)
fn schedule(&self, runnable: Runnable<M>, info: ScheduleInfo)
The actual scheduling procedure.
Provided Methods§
Sourcefn begin_schedule(&self)
fn begin_schedule(&self)
Marks the start of a wake, cancellation, or explicit schedule.
Called before the state transition that commits the attempt to enqueue a runnable.
Paired with end_schedule when that attempt returns, including
when it does not publish a runnable.
Sourcefn before_enqueue(&self)
fn before_enqueue(&self)
Runs after the task is marked scheduled and before schedule.
begin_schedule for this attempt has already run.
Sourcefn end_schedule(&self)
fn end_schedule(&self)
Pairs with begin_schedule.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".