pub struct Queue<T> { /* private fields */ }
Expand description

Queue that is limited in size and supports resizing.

This queue implementation has the following characteristics:

  • Resizable (deadqueue::resizable::Queue)
  • Based on deadqueue::unlimited::Queue
  • Has limited capacity with back pressure on push
  • Supports resizing
  • Enabled via the resizable feature in your Cargo.toml

Implementations

Create new empty queue

Get an item from the queue. If the queue is currently empty this method blocks until an item is available.

Try to get an item from the queue. If the queue is currently empty return None instead.

Push an item into the queue

Try to push an item to the queue. If the queue is currently full return the object as Err<T>.

Get capacity of the queue

Get current length of queue

Returns true if the queue is empty.

The number of available items in the queue. If there are no items in the queue this number can become negative and stores the number of futures waiting for an item.

Resize queue. This increases or decreases the queue capacity accordingly.

Note: Increasing the capacity of a queue happens without blocking unless a resize operation is already in progress. Decreasing the capacity can block if there are futures waiting to push items to the queue.

Trait Implementations

Formats the value using the given formatter. Read more

Creates a value from an iterator. 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.