Struct syncbox::DelayQueue
[−]
[src]
pub struct DelayQueue<T: Delayed + Send> { /* fields omitted */ }
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.
Methods
impl<T: Delayed + Send> DelayQueue<T>
[src]
fn new() -> DelayQueue<T>
Create a new DelayQueue
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
impl<T: Delayed + Send> Queue<T> for DelayQueue<T>
[src]
fn poll(&self) -> Option<T>
Retrieves and removes the head of this queue or returns None if the queue is empty. Read more
fn is_empty(&self) -> bool
Returns true if the underlying data structure does not contain any elements. Read more
fn offer(&self, e: T) -> Result<(), T>
impl<T: Delayed + Send> SyncQueue<T> for DelayQueue<T>
[src]
fn take(&self) -> T
Retrieves and removes the head of this queue, waiting if necessary until an element becomes available. Read more
fn put(&self, e: T)
impl<T: Delayed + Send> Clone for DelayQueue<T>
[src]
fn clone(&self) -> DelayQueue<T>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more