Skip to main content

BlockingQueueReader

Trait BlockingQueueReader 

Source
pub trait BlockingQueueReader<E: Element>: BlockingQueueBase<E> {
    // Required method
    fn take<'life0, 'async_trait>(
        &'life0 mut self,
    ) -> Pin<Box<dyn Future<Output = Result<Option<E>, QueueError<E>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}

Required Methods§

Source

fn take<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<Option<E>, QueueError<E>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Retrieve the head of this queue and delete it. If necessary, wait until an element becomes available.
このキューの先頭を取得して削除します。必要に応じて、要素が利用可能になるまで待機します。

§Return Value / 戻り値
  • Ok(Some(element)) - If the element is retrieved successfully. / 要素が正常に取得された場合。
  • Ok(None) - If the queue is empty. / キューが空の場合。
  • Err(QueueError::InterruptedError) - If the operation is interrupted. / 操作が中断された場合。

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§