Struct npnc::bounded::spsc::Consumer [−][src]
pub struct Consumer<T>(_);
A consumer for a bounded SPSC wait-free queue.
Methods
impl<T> Consumer<T>
[src]
impl<T> Consumer<T>
pub fn consume(&self) -> Result<T, ConsumeError>
[src]
pub fn consume(&self) -> Result<T, ConsumeError>
Attempts to remove and return the item at the front of the queue.
This method returns Err
if the queue is empty.
pub fn len(&self) -> usize
[src]
pub fn len(&self) -> usize
Returns the number of items currently in the queue.
pub fn is_empty(&self) -> bool
[src]
pub fn is_empty(&self) -> bool
Returns whether the queue is currently empty.
pub fn capacity(&self) -> usize
[src]
pub fn capacity(&self) -> usize
Returns the maximum number of items the queue can contain.
Trait Implementations
impl<T: Debug> Debug for Consumer<T>
[src]
impl<T: Debug> Debug for Consumer<T>
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<T> Drop for Consumer<T>
[src]
impl<T> Drop for Consumer<T>
impl<T> Send for Consumer<T> where
T: Send,
[src]
impl<T> Send for Consumer<T> where
T: Send,