#[repr(C)]pub struct TimerList<T> { /* private fields */ }
Expand description
A queue for managing multiple TimerEntry
.
Implementations§
Source§impl<T> TimerList<T>
impl<T> TimerList<T>
Sourcepub fn insert(&mut self, timestamp: u64, t: T)
pub fn insert(&mut self, timestamp: u64, t: T)
Inserts an element at timestamp
within the deque, shifting all elements
with indices greater than or equal to timestamp
towards the back.
Sourcepub fn front(&self) -> Option<(&u64, &TimerEntry<T>)>
pub fn front(&self) -> Option<(&u64, &TimerEntry<T>)>
Provides a reference to the front element, or None
if the deque is empty.
Sourcepub fn pop_front(&mut self) -> Option<(u64, TimerEntry<T>)>
pub fn pop_front(&mut self) -> Option<(u64, TimerEntry<T>)>
Removes the first element and returns it, or None
if the deque is empty.
Sourcepub fn remove_entry(&mut self, timestamp: &u64) -> Option<TimerEntry<T>>
pub fn remove_entry(&mut self, timestamp: &u64) -> Option<TimerEntry<T>>
Removes and returns the element at timestamp
from the deque.
Whichever end is closer to the removal point will be moved to make
room, and all the affected elements will be moved to new positions.
Returns None
if timestamp
is out of bounds.
Sourcepub fn remove(&mut self, timestamp: &u64, t: &T) -> Option<T>where
T: Ord,
pub fn remove(&mut self, timestamp: &u64, t: &T) -> Option<T>where
T: Ord,
Removes and returns the t
from the deque.
Whichever end is closer to the removal point will be moved to make
room, and all the affected elements will be moved to new positions.
Returns None
if t
not found.
Sourcepub fn iter(&self) -> Iter<'_, u64, TimerEntry<T>>
pub fn iter(&self) -> Iter<'_, u64, TimerEntry<T>>
Returns a front-to-back iterator.