Producer

Trait Producer 

Source
pub trait Producer<T> {
    // Required methods
    fn capacity(&self) -> usize;
    fn len(&self) -> usize;
    fn maybe_push(&self, value: T) -> Result<(), T>;

    // Provided methods
    fn is_empty(&self) -> bool { ... }
    fn free_slots(&self) -> usize { ... }
}
Expand description

A producer of a queue.

Required Methods§

Source

fn capacity(&self) -> usize

Returns the capacity of the queue.

Source

fn len(&self) -> usize

Returns the length of the queue.

Source

fn maybe_push(&self, value: T) -> Result<(), T>

Pushes a value only if the queue is not full. It returns an error if the queue is full.

It may be non-lock-free.

Provided Methods§

Source

fn is_empty(&self) -> bool

Returns whether the queue is empty.

Source

fn free_slots(&self) -> usize

Returns the number of free slots in the queue.

Implementors§

Source§

impl<T, const CAPACITY: usize, AtomicWrapper> Producer<T> for MPMCBoundedQueue<T, CAPACITY, AtomicWrapper>
where AtomicWrapper: Deref<Target = LongAtomic> + Default,

Source§

impl<T: Send, SC: SyncCell<LightArc<Version<T>>>> Producer<T> for CachePaddedSPMCUnboundedProducer<T, SC>

Source§

impl<T: Send, SC: SyncCell<LightArc<Version<T>>>> Producer<T> for SPMCUnboundedProducer<T, SC>

Source§

impl<T: Send, SC: SyncCell<LightArc<Version<T>>>> Producer<T> for CachePaddedSPSCUnboundedProducer<T, SC>

Source§

impl<T: Send, SC: SyncCell<LightArc<Version<T>>>> Producer<T> for SPSCUnboundedProducer<T, SC>

Source§

impl<T: Send, const CAPACITY: usize> Producer<T> for CachePaddedMPMCProducer<T, CAPACITY>

Source§

impl<T: Send, const CAPACITY: usize> Producer<T> for MPMCProducer<T, CAPACITY>

Source§

impl<T: Send, const CAPACITY: usize> Producer<T> for CachePaddedSPMCProducer<T, CAPACITY>

Source§

impl<T: Send, const CAPACITY: usize> Producer<T> for SPMCProducer<T, CAPACITY>

Source§

impl<T: Send, const CAPACITY: usize> Producer<T> for CachePaddedSPSCProducer<T, CAPACITY>

Source§

impl<T: Send, const CAPACITY: usize> Producer<T> for SPSCProducer<T, CAPACITY>