pub struct DelayQueue<T> { /* private fields */ }Expand description
A queue of values that become available after their deadlines elapse.
The queue owns one operating-system timer and multiplexes all entries through a min-heap, so adding many timers does not consume one native timer handle per entry.
Implementations§
Source§impl<T> DelayQueue<T>
impl<T> DelayQueue<T>
Sourcepub fn insert_at(&mut self, value: T, deadline: Instant) -> Key
pub fn insert_at(&mut self, value: T, deadline: Instant) -> Key
Inserts value and returns a key that can remove it before expiration.
Sourcepub fn try_insert(&mut self, value: T, timeout: Duration) -> Result<Key>
pub fn try_insert(&mut self, value: T, timeout: Duration) -> Result<Key>
Tries to insert value to expire after timeout.
Trait Implementations§
Auto Trait Implementations§
impl<T> !RefUnwindSafe for DelayQueue<T>
impl<T> !UnwindSafe for DelayQueue<T>
impl<T> Freeze for DelayQueue<T>
impl<T> Send for DelayQueue<T>
impl<T> Sync for DelayQueue<T>
impl<T> Unpin for DelayQueue<T>
impl<T> UnsafeUnpin for DelayQueue<T>where
Slab<Slot<T>>: UnsafeUnpin,
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