pub trait Scheduler: Send + Sync + 'static {
// Required methods
fn next(&mut self) -> TaskRef;
fn add(&mut self, task: TaskRef);
fn busyness(&self) -> usize;
fn remove(&mut self, task: &TaskRef) -> bool;
fn as_priority_scheduler(&mut self) -> Option<&mut dyn PriorityScheduler>;
fn drain(&mut self) -> Box<dyn Iterator<Item = TaskRef> + '_>;
fn tasks(&self) -> Vec<TaskRef>;
}
Expand description
A task scheduler.
Required Methods§
sourcefn busyness(&self) -> usize
fn busyness(&self) -> usize
Returns a measure of how busy the scheduler is, with higher values representing a busier scheduler.
sourcefn as_priority_scheduler(&mut self) -> Option<&mut dyn PriorityScheduler>
fn as_priority_scheduler(&mut self) -> Option<&mut dyn PriorityScheduler>
Returns a reference to this scheduler as a priority scheduler, if it is one.