pub struct SimChannel { /* private fields */ }Expand description
A simulated network channel that holds queued datagrams and delivers them at the scheduled Instant.
Implementations§
Source§impl SimChannel
impl SimChannel
Sourcepub fn push(&mut self, datagram: QueuedDatagram)
pub fn push(&mut self, datagram: QueuedDatagram)
Pushes a new datagram into the channel, maintaining delivery order.
Sourcepub fn pop_ready(&mut self, now: Instant) -> Option<QueuedDatagram>
pub fn pop_ready(&mut self, now: Instant) -> Option<QueuedDatagram>
Pops the next ready datagram from the channel, if its delivery time is <= now.
Trait Implementations§
Source§impl Debug for SimChannel
impl Debug for SimChannel
Source§impl Default for SimChannel
impl Default for SimChannel
Source§fn default() -> SimChannel
fn default() -> SimChannel
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for SimChannel
impl RefUnwindSafe for SimChannel
impl Send for SimChannel
impl Sync for SimChannel
impl Unpin for SimChannel
impl UnsafeUnpin for SimChannel
impl UnwindSafe for SimChannel
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