Trait QueueBehavior

Source
pub trait QueueBehavior<E>: Send + Sized {
    // Required methods
    fn len(&self) -> QueueSize;
    fn capacity(&self) -> QueueSize;
    fn offer(&mut self, e: E) -> Result<()>;
    fn poll(&mut self) -> Result<Option<E>>;

    // Provided methods
    fn is_empty(&self) -> bool { ... }
    fn non_empty(&self) -> bool { ... }
    fn is_full(&self) -> bool { ... }
    fn non_full(&self) -> bool { ... }
}

Required Methods§

Source

fn len(&self) -> QueueSize

Returns the length of this queue.
このキューの長さを返します。

Source

fn capacity(&self) -> QueueSize

Returns the capacity of this queue.
このキューの最大容量を返します。

Source

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

The specified element will be inserted into this queue, if the queue can be executed immediately without violating the capacity limit.
容量制限に違反せずにすぐ実行できる場合は、指定された要素をこのキューに挿入します。

Source

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

Retrieves and deletes the head of the queue. Returns None if the queue is empty.
キューの先頭を取得および削除します。キューが空の場合は None を返します。

Provided Methods§

Source

fn is_empty(&self) -> bool

Returns whether this queue is empty.
このキューが空かどうかを返します。

Source

fn non_empty(&self) -> bool

Returns whether this queue is non-empty.
このキューが空でないかどうかを返します。

Source

fn is_full(&self) -> bool

Returns whether the queue size has reached its capacity.
このキューのサイズが容量まで到達したかどうかを返します。

Source

fn non_full(&self) -> bool

Returns whether the queue size has not reached its capacity.
このキューのサイズが容量まで到達してないかどうかを返します。

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> QueueBehavior<E> for QueueMPSC<E>

Source§

impl<E: Element + 'static> QueueBehavior<E> for QueueVec<E>

Source§

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

Source§

impl<T: Element + 'static> QueueBehavior<T> for Queue<T>