pub trait ProduceConsume<T> {
// Required methods
fn produce(&mut self, data: T);
fn consume(&mut self) -> Option<T>;
fn len(&self) -> usize;
fn is_empty(&self) -> bool;
}Expand description
Common trait for data structure usable as a producer-consumer medium.
Required Methods§
Sourcefn consume(&mut self) -> Option<T>
fn consume(&mut self) -> Option<T>
Consume a value.
This method moves out a value from the object.