[][src]Struct flume::Receiver

pub struct Receiver<T> { /* fields omitted */ }

The receiving end of a channel.

Implementations

impl<T> Receiver<T>[src]

pub fn recv(&self) -> Result<T, RecvError>[src]

Wait for an incoming value from the channel associated with this receiver, returning an error if all channel senders have been dropped.

pub fn recv_timeout(&self, timeout: Duration) -> Result<T, RecvTimeoutError>[src]

Wait for an incoming value from the channel associated with this receiver, returning an error if all channel senders have been dropped or the timeout has expired.

pub fn recv_deadline(&self, deadline: Instant) -> Result<T, RecvTimeoutError>[src]

Wait for an incoming value from the channel associated with this receiver, returning an error if all channel senders have been dropped or the deadline has passed.

pub fn recv_async(&mut self) -> RecvFuture<T>

Important traits for RecvFuture<'a, T>

impl<'a, T> Future for RecvFuture<'a, T> type Output = Result<T, RecvError>;
[src]

Create a future that may be used to wait asynchronously for an incoming value on the channel associated with this receiver.

pub fn try_recv(&self) -> Result<T, TryRecvError>[src]

Attempt to fetch an incoming value from the channel associated with this receiver, returning an error if the channel is empty or all channel senders have been dropped.

pub fn iter(&self) -> Iter<T>

Important traits for Iter<'a, T>

impl<'a, T> Iterator for Iter<'a, T> type Item = T;
[src]

A blocking iterator over the values received on the channel that finishes iteration when all receivers of the channel have been dropped.

pub fn try_iter(&self) -> TryIter<T>

Important traits for TryIter<'a, T>

impl<'a, T> Iterator for TryIter<'a, T> type Item = T;
[src]

A non-blocking iterator over the values received on the channel that finishes iteration when all receivers of the channel have been dropped or the channel is empty.

pub fn drain(&self) -> Drain<T>

Important traits for Drain<'a, T>

impl<'a, T> Iterator for Drain<'a, T> type Item = T;
[src]

Take all items currently sitting in the channel and produce an iterator over them. Unlike try_iter, the iterator will not attempt to fetch any more values from the channel once the function has been called.

Trait Implementations

impl<T> Debug for Receiver<T>[src]

impl<T> Drop for Receiver<T>[src]

impl<T> FusedStream for Receiver<T>[src]

impl<T> IntoIterator for Receiver<T>[src]

type Item = T

The type of the elements being iterated over.

type IntoIter = IntoIter<T>

Which kind of iterator are we turning this into?

impl<T> Stream for Receiver<T>[src]

type Item = T

Values yielded by the stream.

Auto Trait Implementations

impl<T> !RefUnwindSafe for Receiver<T>

impl<T> Send for Receiver<T> where
    T: Send

impl<T> !Sync for Receiver<T>

impl<T> Unpin for Receiver<T> where
    T: Unpin

impl<T> !UnwindSafe for Receiver<T>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<I> IntoIterator for I where
    I: Iterator
[src]

type Item = <I as Iterator>::Item

The type of the elements being iterated over.

type IntoIter = I

Which kind of iterator are we turning this into?

impl<T> StreamExt for T where
    T: Stream + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<S, T, E> TryStream for S where
    S: Stream<Item = Result<T, E>> + ?Sized
[src]

type Ok = T

The type of successful values yielded by this future

type Error = E

The type of failures yielded by this future

impl<S> TryStreamExt for S where
    S: TryStream + ?Sized
[src]