pub struct EventQueue { /* private fields */ }Expand description
EventQueue represents the queue of events that are waiting to be processed in order (time-wise). The queue is split into four parts:
- base: TriggerEvent::NormalSent events that are from the parsed base trace
- blocking: TunnelSent events that may be blocked by blocking machines
- bypassable: TunnelSent events that are blocked with bypassable blocking
- internal: all other events
Implementations§
Source§impl EventQueue
impl EventQueue
pub fn new() -> EventQueue
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Sourcepub fn no_normal_packets(&self) -> bool
pub fn no_normal_packets(&self) -> bool
Checks if there are no normal packets in the queue. This involves checking the base queue for TriggerEvent::NormalSent events, the blocking and bypassable queues for TriggerEvent::TunnelSent events without the padding flag, and the internal queue for any TunnelRecv without the padding flag.
pub fn push(&mut self, item: SimEvent)
pub fn peek( &self, network_delay_sum: Duration, current_time: Instant, ) -> (Option<&SimEvent>, Queue, Duration)
Sourcepub fn pop(&mut self, q: Queue, network_delay_sum: Duration) -> Option<SimEvent>
pub fn pop(&mut self, q: Queue, network_delay_sum: Duration) -> Option<SimEvent>
remove an event from the queue
Sourcepub fn peek_blocking(&self) -> Option<&SimEvent>
pub fn peek_blocking(&self) -> Option<&SimEvent>
peek the next blocking event
Sourcepub fn peek_bypassable(&self) -> Option<&SimEvent>
pub fn peek_bypassable(&self) -> Option<&SimEvent>
peek the next bypassable event
Sourcepub fn peek_non_blocking(
&self,
network_delay_sum: Duration,
) -> (Option<&SimEvent>, Queue)
pub fn peek_non_blocking( &self, network_delay_sum: Duration, ) -> (Option<&SimEvent>, Queue)
peek the next non-blocking event
Sourcepub fn get_first_base_time(&self) -> Option<Instant>
pub fn get_first_base_time(&self) -> Option<Instant>
get the first time of the base queue: should only be used for the simulator’s current time at startup
Trait Implementations§
Source§impl Clone for EventQueue
impl Clone for EventQueue
Source§fn clone(&self) -> EventQueue
fn clone(&self) -> EventQueue
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 moreSource§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 UnsafeUnpin 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