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 free slots in the ring buffer.
The number of actual blocks written is returned in the Option
value.
Returns None
if the given slice has zero length.