Struct nolock::queues::spsc::unbounded::UnboundedSender [−][src]
pub struct UnboundedSender<T> { /* fields omitted */ }
Expand description
The Sender-Half of an unbounded Queue
Implementations
Checks if the Queue has been closed by the Consumer
Example
let (rx, tx) = unbounded::queue::<usize>(); // Drop the Consumer and therefore also close the Queue drop(rx); assert_eq!(true, tx.is_closed());
Enqueues the Data
Example
Normal Enqueue, where the Queue is not closed
let (rx, mut tx) = unbounded::queue::<usize>(); assert_eq!(Ok(()), tx.enqueue(13));
Failed Enqueue, the Queue has been closed
let (rx, mut tx) = unbounded::queue::<usize>(); // Drop the Consumer and therefore also close the Queue drop(rx); assert_eq!(Err((13, EnqueueError::Closed)), tx.enqueue(13));
Trait Implementations
Auto Trait Implementations
impl<T> !RefUnwindSafe for UnboundedSender<T>
impl<T> Unpin for UnboundedSender<T>
impl<T> !UnwindSafe for UnboundedSender<T>