[−][src]Struct deadqueue::unlimited::Queue
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 yourCargo.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]
fn from_iter<I: IntoIterator<Item = T>>(iter: I) -> Self
[src]
Auto Trait Implementations
impl<T> !RefUnwindSafe for Queue<T>
impl<T> Send for Queue<T> where
T: Send,
T: Send,
impl<T> Sync for Queue<T> where
T: Send,
T: Send,
impl<T> Unpin for Queue<T> where
T: Unpin,
T: Unpin,
impl<T> !UnwindSafe for Queue<T>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,