pub(crate) trait Schedule: Sync + Sized + 'static {
// Required methods
fn release(&self, task: &Task<Self>) -> Option<Task<Self>>;
fn schedule(&self, task: Notified<Self>);
fn hooks(&self) -> TaskHarnessScheduleHooks;
// Provided methods
fn yield_now(&self, task: Notified<Self>) { ... }
fn unhandled_panic(&self) { ... }
}
Required Methods§
sourcefn release(&self, task: &Task<Self>) -> Option<Task<Self>>
fn release(&self, task: &Task<Self>) -> Option<Task<Self>>
The task has completed work and is ready to be released. The scheduler should release it immediately and return it. The task module will batch the ref-dec with setting other options.
If the scheduler has already released the task, then None is returned.
fn hooks(&self) -> TaskHarnessScheduleHooks
Provided Methods§
sourcefn yield_now(&self, task: Notified<Self>)
fn yield_now(&self, task: Notified<Self>)
Schedule the task to run in the near future, yielding the thread to other tasks.
sourcefn unhandled_panic(&self)
fn unhandled_panic(&self)
Polling the task resulted in a panic. Should the runtime shutdown?
Object Safety§
This trait is not object safe.