[][src]Struct deadqueue::unlimited::Queue

pub struct Queue<T> { /* fields omitted */ }

Queue that is unlimited in size.

This queue implementation has the following characteristics:

  • Based on crossbeam_queue::SegQueue
  • Has unlimitied capacity and no back pressure on push
  • Enabled via the unlimited feature in your Cargo.toml

Methods

impl<T> Queue<T>[src]

pub fn new() -> Self[src]

Create new empty queue

pub async fn pop<'_>(&'_ self) -> T[src]

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

pub fn try_pop(&self) -> Option<T>[src]

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

pub fn push(&self, item: T)[src]

Push an item into the queue

pub fn len(&self) -> usize[src]

Get current length of queue

pub fn available(&self) -> isize[src]

Get available count. This is the difference between the current queue length and the number of tasks waiting for an item of the queue.

Trait Implementations

impl<T> Default for Queue<T>[src]

impl<T> FromIterator<T> for Queue<T>[src]

Auto Trait Implementations

impl<T> !RefUnwindSafe for Queue<T>

impl<T> Send for Queue<T> where
    T: Send

impl<T> Sync for Queue<T> where
    T: Send

impl<T> Unpin for Queue<T> where
    T: Unpin

impl<T> !UnwindSafe for Queue<T>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.