Trait rb::RbProducer [] [src]

pub trait RbProducer<T> {
    fn write(&self, &[T]) -> Result<usize>;
    fn write_blocking(&self, &[T]) -> Option<usize>;
}

Defines write methods for a producer view.

Required Methods

fn write(&self, &[T]) -> Result<usize>

Stores the given slice of data into the ring buffer. Returns the number of written elements or an error.

Possible errors:

  • RbError::Full

fn write_blocking(&self, &[T]) -> Option<usize>

Works analog to write but blocks until there are as much free slots in the ring buffer as there are elements in the given slice.

Returns None if the given slice has zero length.

Implementors