pub trait TryIterRecv<'a> {
type Iter: Iterator + 'a;
type Error;
// Required methods
fn try_iter(&'a self) -> Self::Iter;
fn recv(&self) -> Result<<Self::Iter as Iterator>::Item, Self::Error>;
}Expand description
Trait for queues which have batch-able receiving method.
This is mainly used by BatchRecv trait.
At first, BatchRecv trait calls recv
which blocks the thread until the first value comes.
And then, it calls try_iter to retrieve the following values.
Required Associated Types§
Required Methods§
fn try_iter(&'a self) -> Self::Iter
fn recv(&self) -> Result<<Self::Iter as Iterator>::Item, Self::Error>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".