pub struct Scheduler { /* private fields */ }
Expand description
Scheduler is used to keep the current time and information about the upcoming events.
See the crate-level documentation for more information.
Implementations
sourceimpl Scheduler
impl Scheduler
sourcepub fn schedule<E: Debug + 'static>(
&mut self,
time: Duration,
component: ComponentId<E>,
event: E
)
pub fn schedule<E: Debug + 'static>(
&mut self,
time: Duration,
component: ComponentId<E>,
event: E
)
Schedules event
to be executed for component
at self.time() + time
.
sourcepub fn schedule_now<E: Debug + 'static>(
&mut self,
component: ComponentId<E>,
event: E
)
pub fn schedule_now<E: Debug + 'static>(
&mut self,
component: ComponentId<E>,
event: E
)
Schedules event
to be executed for component
at self.time()
.
sourcepub fn clock(&self) -> ClockRef
pub fn clock(&self) -> ClockRef
Returns a structure with immutable access to the simulation time.
sourcepub fn peek(&mut self) -> Option<&EventEntry>
pub fn peek(&mut self) -> Option<&EventEntry>
Returns a reference to the next scheduled event or None
if none are left.
sourcepub fn pop(&mut self) -> Option<EventEntry>
pub fn pop(&mut self) -> Option<EventEntry>
Removes and returns the next scheduled event or None
if none are left.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Scheduler
impl !Send for Scheduler
impl !Sync for Scheduler
impl Unpin for Scheduler
impl !UnwindSafe for Scheduler
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more