AsyncSendTryGetFut

Trait AsyncSendTryGetFut 

Source
pub trait AsyncSendTryGetFut<'a>: 'a + Send {
    type Input: 'a + Sync + Send;
    type Output: 'a + Send;
    type Aux: 'a + Send;
    type Error: 'a + Send;

    // Required method
    fn async_send_try_get_fut<'b>(
        self,
        input: &'b mut Self::Input,
    ) -> Pin<Box<dyn Send + Future<Output = Result<(Pin<Box<dyn Send + Future<Output = Self::Output> + 'b>>, Self::Aux), Self::Error>> + 'b>>;
}
Expand description

A functor trait for trying to get a complex future from an input.

Required Associated Types§

Source

type Input: 'a + Sync + Send

The input type of the functor. Will be returned to the caller if unsuccessful.

Source

type Output: 'a + Send

The output type of the resulting future if successful.

Source

type Aux: 'a + Send

Auxiliary data that should be returned to the caller if successful.

Source

type Error: 'a + Send

Error data that should be returned to the caller if unsuccessful.

Required Methods§

Source

fn async_send_try_get_fut<'b>( self, input: &'b mut Self::Input, ) -> Pin<Box<dyn Send + Future<Output = Result<(Pin<Box<dyn Send + Future<Output = Self::Output> + 'b>>, Self::Aux), Self::Error>> + 'b>>

The functor applicator.

Takes a mutable reference some input and returns either a future and some auxiliary data or an error.

For now this has to use Pin<Box<dyn Future>> due a compiler bug (rust-lang/rust#100013). This will change in a future release when this bug is fixed.

Implementors§