Trait SendAsync

Source
pub trait SendAsync<M, R: Send + 'static> {
    // Required method
    fn send_async(
        &self,
        message: M,
    ) -> BoxFuture<'static, Result<R, AsyncSendError>>;
}
Expand description

Extension trait (not for anyone to implement), that allows a Sender<MessageWithCallback<M, R>> to be used to send a message and then getting a future of the response.

See AsyncSendError for reasons that the future may resolve to an error result.

Required Methods§

Source

fn send_async( &self, message: M, ) -> BoxFuture<'static, Result<R, AsyncSendError>>

Implementors§

Source§

impl<M, R: Send + 'static, A: CanSend<MessageWithCallback<M, R>> + ?Sized> SendAsync<M, R> for A