pub struct EventQueue { /* private fields */ }
Expand description
A queue of Event
s ordered by their times.
Implementations§
source§impl EventQueue
impl EventQueue
pub fn new() -> Self
sourcepub fn push(&mut self, event: Event)
pub fn push(&mut self, event: Event)
Push a new Event
on to the queue.
Will panic if two events are pushed that have no relative order
(event_a.partial_cmp(&event_b) == None
). Will be non-deterministic if two events are
pushed that are equal (event_a == event_b
).
Will panic if the event time is earlier than the last popped event time (time moves backward).
sourcepub fn next_event_time(&self) -> Option<EmulatedTime>
pub fn next_event_time(&self) -> Option<EmulatedTime>
The time of the next Event
(the time of the earliest event in the queue).
Trait Implementations§
source§impl Debug for EventQueue
impl Debug for EventQueue
Auto Trait Implementations§
impl Freeze for EventQueue
impl !RefUnwindSafe for EventQueue
impl Send for EventQueue
impl Sync for EventQueue
impl Unpin for EventQueue
impl !UnwindSafe for EventQueue
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
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more