Trait BlockingQueueBehavior

Source
pub trait BlockingQueueBehavior<E: Element>: QueueBehavior<E> + Send {
    // Required methods
    fn put(&mut self, e: E) -> Result<()>;
    fn take(&mut self) -> Result<Option<E>>;
}

Required Methods§

Source

fn put(&mut self, e: E) -> Result<()>

Inserts the specified element into this queue. If necessary, waits until space is available.
指定された要素をこのキューに挿入します。必要に応じて、空きが生じるまで待機します。

Source

fn take(&mut self) -> Result<Option<E>>

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

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<E: Element + 'static, Q: QueueBehavior<E>> BlockingQueueBehavior<E> for BlockingQueue<E, Q>