Struct nolock::queues::spsc::unbounded::UnboundedReceiver [−][src]
pub struct UnboundedReceiver<T> { /* fields omitted */ }
Expand description
The Receiver-Half of an unbounded Queue
Implementations
Checks if the Queue has been closed by the Producer
Example
let (rx, tx) = unbounded::queue::<usize>(); // Dropping the Producer and therefore closing the Queue drop(tx); assert_eq!(true, rx.is_closed());
Attempts to dequeue a single Element from the Queue
Example
Successful Dequeue
let (mut rx, mut tx) = unbounded::queue::<usize>(); tx.enqueue(13).unwrap(); assert_eq!(Ok(13), rx.try_dequeue());
Dequeue on empty Queue
let (mut rx, mut tx) = unbounded::queue::<usize>(); assert_eq!(Err(DequeueError::WouldBlock), rx.try_dequeue());
Trait Implementations
Auto Trait Implementations
impl<T> !RefUnwindSafe for UnboundedReceiver<T>
impl<T> Unpin for UnboundedReceiver<T>
impl<T> !UnwindSafe for UnboundedReceiver<T>