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

Formats the value using the given formatter. Read more

Executes the destructor for this type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.