pub struct Scheduler { /* private fields */ }Expand description
Tracks scheduling state for all registered edges and accumulates a queue of edge ids that are ready to execute.
Implementations§
Source§impl Scheduler
impl Scheduler
Sourcepub fn register(&mut self, edge: &HyperEdge)
pub fn register(&mut self, edge: &HyperEdge)
Register an edge with the scheduler.
The scheduling policy is taken from the edge’s EdgeSchedule.
Sourcepub fn notify_change(&mut self, port: PortId)
pub fn notify_change(&mut self, port: PortId)
Notify the scheduler that port has a new value.
All OnChange edges whose source list includes port are enqueued.
Sourcepub fn tick(&mut self, delta: Duration)
pub fn tick(&mut self, delta: Duration)
Advance time by delta. All OnTick edges whose interval has elapsed
are enqueued (and their elapsed counter resets to zero).
Sourcepub fn fire_event(&mut self, name: &str)
pub fn fire_event(&mut self, name: &str)
Fire a named event, enqueuing all edges registered for that event name.
Sourcepub fn drain_pending(&mut self) -> Vec<EdgeId>
pub fn drain_pending(&mut self) -> Vec<EdgeId>
Drain the pending queue, returning edge ids in FIFO order.
Duplicate ids are deduplicated while preserving first-occurrence order.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Scheduler
impl RefUnwindSafe for Scheduler
impl Send for Scheduler
impl Sync for Scheduler
impl Unpin for Scheduler
impl UnsafeUnpin for Scheduler
impl UnwindSafe for Scheduler
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more