Struct nolock::queues::mpsc::jiffy::AsyncReceiver[][src]

pub struct AsyncReceiver<T> { /* fields omitted */ }
Expand description

This is the asynchronous Version of the Jiffy-Receiver

Implementations

Checks if the current Queue has been closed by the Producer

Note

This does not mean, that there are no more Elements in the Queue currently. It only indicates that there will be no new Elements inserted into the Queue, but there might still be a any number of Elements currently still left in the Queue.

This attempts to dequeue the first Element in the Queue.

This is the same as try_dequeue on the normal Jiffy-Queue

This is the asynchronous version of the blocking dequeue operation on the normal Jiffy-Queue

Behaviour

The Future returned, will either resolve once an item is ready to be dequeued (Ok) or the Queue encountered a “fatal” error, like when the other side closes the Queue (Err)

Example


async fn demo() {
  let (mut rx, tx) = jiffy::async_queue::<usize>();

  tx.enqueue(13).unwrap();

  assert_eq!(Ok(13), rx.dequeue().await);
}

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

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.