Trait TryIterRecv

Source
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§

Source

fn try_iter(&'a self) -> Self::Iter

Source

fn recv(&self) -> Result<<Self::Iter as Iterator>::Item, Self::Error>

Implementations on Foreign Types§

Source§

impl<'a, T: 'a> TryIterRecv<'a> for Receiver<T>

Source§

type Iter = TryIter<'a, T>

Source§

type Error = RecvError

Source§

fn try_iter(&'a self) -> TryIter<'a, T>

Source§

fn recv(&self) -> Result<T, Self::Error>

Implementors§