[][src]Trait magnetic::Consumer

pub trait Consumer<T> {
    pub fn pop(&self) -> Result<T, PopError>;
pub fn try_pop(&self) -> Result<T, TryPopError>; }

The consumer end of the queue allows for receiving data. Consumer<T> is always Send, but is only Sync for multi-consumer (SPMC, MPMC) queues.

Required methods

pub fn pop(&self) -> Result<T, PopError>[src]

Remove value from the end of the queue. This method will block if the queue is currently empty.

pub fn try_pop(&self) -> Result<T, TryPopError>[src]

Attempt to remove a value from the end of the queue. If the value was removed successfully, Some(T) will be returned. If unsuccessful, None will be returned. An unsuccessful pop indicates that the queue was empty.

Loading content...

Implementors

impl<T, B: Buffer<T>> Consumer<T> for MPMCConsumer<T, B>[src]

impl<T, B: Buffer<T>> Consumer<T> for MPSCConsumer<T, B>[src]

impl<T, B: Buffer<T>> Consumer<T> for SPMCConsumer<T, B>[src]

impl<T, B: Buffer<T>> Consumer<T> for SPSCConsumer<T, B>[src]

Loading content...