pub struct EventQueues { /* private fields */ }Expand description
Bounded priority queues for station events.
Implementations§
Source§impl EventQueues
impl EventQueues
Sourcepub fn new(limits: EventQueueLimits) -> Self
pub fn new(limits: EventQueueLimits) -> Self
Creates empty event queues.
Sourcepub fn push(
&mut self,
event: StationEvent,
) -> Result<PushOutcome, EventQueueError>
pub fn push( &mut self, event: StationEvent, ) -> Result<PushOutcome, EventQueueError>
Pushes an event according to priority and queue semantics.
Sourcepub fn pop_next(&mut self) -> Option<StationEvent>
pub fn pop_next(&mut self) -> Option<StationEvent>
Pops the next event, preferring higher priority.
Sourcepub fn drain_ready_into(
&mut self,
current_tick: Tick,
out: &mut Vec<StationEvent>,
) -> usize
pub fn drain_ready_into( &mut self, current_tick: Tick, out: &mut Vec<StationEvent>, ) -> usize
Appends events ready at current_tick while retaining delayed events in place.
Priority and FIFO order match repeated Self::pop_next calls. The
caller owns out and may retain its capacity across ticks.
Sourcepub fn retained_capacity(&self, priority: EventPriority) -> usize
pub fn retained_capacity(&self, priority: EventPriority) -> usize
Returns slots retained by one event priority queue.
Sourcepub fn total_retained_capacity(&self) -> usize
pub fn total_retained_capacity(&self) -> usize
Returns slots retained across all event priority queues.
Trait Implementations§
Source§impl Clone for EventQueues
impl Clone for EventQueues
Source§fn clone(&self) -> EventQueues
fn clone(&self) -> EventQueues
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for EventQueues
impl RefUnwindSafe for EventQueues
impl Send for EventQueues
impl Sync for EventQueues
impl Unpin for EventQueues
impl UnsafeUnpin for EventQueues
impl UnwindSafe for EventQueues
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