pub type OutcomeReceiver = Receiver<(TaskGroup, TaskOutcome)>;
Expand description

Channel receiver for task outcomes

Aliased Type§

struct OutcomeReceiver { /* private fields */ }

Implementations§

§

impl<T> Receiver<T>

pub fn close(&mut self)

Closes the receiving half of a channel, without dropping it.

This prevents any further messages from being sent on the channel while still enabling the receiver to drain messages that are buffered.

pub fn try_next(&mut self) -> Result<Option<T>, TryRecvError>

Tries to receive the next message without notifying a context if empty.

It is not recommended to call this function from inside of a future, only when you’ve otherwise arranged to be notified when the channel is no longer empty.

This function returns:

  • Ok(Some(t)) when message is fetched
  • Ok(None) when channel is closed and no messages left in the queue
  • Err(e) when there are no messages available, but channel is not yet closed

Trait Implementations§

§

impl<T> Debug for Receiver<T>

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl<T> Drop for Receiver<T>

§

fn drop(&mut self)

Executes the destructor for this type. Read more
§

impl<T> FusedStream for Receiver<T>

§

fn is_terminated(&self) -> bool

Returns true if the stream should no longer be polled.
§

impl<T> Stream for Receiver<T>

§

type Item = T

Values yielded by the stream.
§

fn poll_next( self: Pin<&mut Receiver<T>>, cx: &mut Context<'_> ) -> Poll<Option<T>>

Attempt to pull out the next value of this stream, registering the current task for wakeup if the value is not yet available, and returning None if the stream is exhausted. Read more
§

fn size_hint(&self) -> (usize, Option<usize>)

Returns the bounds on the remaining length of the stream. Read more
source§

impl<E> GhostChannelReceiver<E> for Receiver<E>where E: GhostEvent,

§

impl<T> Unpin for Receiver<T>