pub struct GlobalClock<E> { /* private fields */ }Expand description
A deterministic event queue ordered by global tick and insertion sequence.
Implementations§
Source§impl<E> GlobalClock<E>
impl<E> GlobalClock<E>
pub fn new() -> Self
Sourcepub fn schedule_at(
&mut self,
tick: GlobalTick,
event: E,
) -> Result<(), ClockFault>
pub fn schedule_at( &mut self, tick: GlobalTick, event: E, ) -> Result<(), ClockFault>
Inserts owned scheduling work at an absolute global tick.
Sourcepub fn schedule_after(
&mut self,
after: GlobalDuration,
event: E,
) -> Result<(), ClockFault>
pub fn schedule_after( &mut self, after: GlobalDuration, event: E, ) -> Result<(), ClockFault>
Converts relative work into an absolute global tick.
Sourcepub fn pop_earliest(&mut self) -> Option<(GlobalTick, E)>
pub fn pop_earliest(&mut self) -> Option<(GlobalTick, E)>
Removes the earliest event and advances the current global tick to it.
pub fn now(&self) -> GlobalTick
pub fn is_empty(&self) -> bool
Trait Implementations§
Auto Trait Implementations§
impl<E> Freeze for GlobalClock<E>
impl<E> RefUnwindSafe for GlobalClock<E>where
E: RefUnwindSafe,
impl<E> Send for GlobalClock<E>where
E: Send,
impl<E> Sync for GlobalClock<E>where
E: Sync,
impl<E> Unpin for GlobalClock<E>where
E: Unpin,
impl<E> UnsafeUnpin for GlobalClock<E>
impl<E> UnwindSafe for GlobalClock<E>where
E: UnwindSafe,
Blanket Implementations§
Source§impl<D> Apply<PushToStack<()>> for D
impl<D> Apply<PushToStack<()>> for D
Source§fn apply(&mut self, _: PushToStack<()>)
fn apply(&mut self, _: PushToStack<()>)
Apply a single effect to this destination.
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