Trait dialectic::backend::Receiver[][src]

pub trait Receiver {
    type Error;
    fn recv_choice<'async_lifetime, const LENGTH: usize>(
        &'async_lifetime mut self
    ) -> Pin<Box<dyn Future<Output = Result<Choice<LENGTH>, Self::Error>> + Send + 'async_lifetime>>; }

A backend transport used for receiving (i.e. the Rx parameter of Chan) must implement Receiver, which specifies what type of errors it might return, as well as giving a method to send Choices across the channel. This is a super-trait of Receive, which is what’s actually needed to receive particular values over a Chan.

If you’re writing a function and need a lot of different Receive<T> bounds, the Receiver attribute macro can help you specify them more succinctly.

Associated Types

type Error[src]

The type of possible errors when receiving.

Loading content...

Required methods

fn recv_choice<'async_lifetime, const LENGTH: usize>(
    &'async_lifetime mut self
) -> Pin<Box<dyn Future<Output = Result<Choice<LENGTH>, Self::Error>> + Send + 'async_lifetime>>
[src]

Receive any Choice<N>. It is impossible to construct a Choice<0>, so if N = 0, a Receiver::Error must be returned.

Loading content...

Implementors

Loading content...