pub struct DelayQueue<T: Delayed + Send> { /* private fields */ }
Expand description
An unbounded blocking queue of delayed values. When a value is pushed onto the queue, a delay is included. The value will only be able to be popped off once the specified delay has expired. The head of the queue is the value whose delay is expired and furthest in the past.
Implementations§
Source§impl<T: Delayed + Send> DelayQueue<T>
impl<T: Delayed + Send> DelayQueue<T>
Sourcepub fn new() -> DelayQueue<T>
pub fn new() -> DelayQueue<T>
Create a new DelayQueue
Sourcepub fn poll_timeout(&self, timeout: Duration) -> Option<T>
pub fn poll_timeout(&self, timeout: Duration) -> Option<T>
Retrieves and removes the head of the queue, blocking if necessary for
up to timeout
.
Trait Implementations§
Source§impl<T: Delayed + Send> Clone for DelayQueue<T>
impl<T: Delayed + Send> Clone for DelayQueue<T>
Source§fn clone(&self) -> DelayQueue<T>
fn clone(&self) -> DelayQueue<T>
Returns a copy of the value. Read more
1.0.0 · 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<T> Freeze for DelayQueue<T>
impl<T> RefUnwindSafe for DelayQueue<T>
impl<T> Send for DelayQueue<T>
impl<T> Sync for DelayQueue<T>
impl<T> Unpin for DelayQueue<T>
impl<T> UnwindSafe for DelayQueue<T>
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