pub struct Sender<T>(_);
Expand description

The sending Half for a SCQ based MPMC-Queue

Implementations

Attempts to Enqueue the given Data

Example
Valid/Normal enqueue
let (rx, tx) = scq::queue::<u64>(10);

assert_eq!(Ok(()), tx.try_enqueue(13));
Queue is already full
let (rx, tx) = scq::queue::<u64>(1);
// Enqueue an Element to fill the Queue
tx.try_enqueue(13);

assert_eq!(Err((EnqueueError::Full, 13)), tx.try_enqueue(13));

Checks if the Receiving Half has closed the Queue, meaning that no more Elements would be dequeued from the Queue and therefore also should not be inserted anymore.

Example
let (rx, tx) = scq::queue::<u64>(10);

assert_eq!(false, tx.is_closed());

drop(rx);

assert_eq!(true, tx.is_closed());

Trait Implementations

Formats the value using the given formatter. 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

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

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.