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

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

Possible errors:

  • RbError::Full

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