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

Allows the sending of a message while expecting a response.

Required Methods§

source

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

Implementations on Foreign Types§

source§

impl<M, A> CanSendAsync<M, Result<<M as Message>::Result, ()>> for Addr<A>where M: Message + Send + 'static, M::Result: Send, A: Actor + Handler<M>, A::Context: ToEnvelope<A, M>,

An actix Addr implements CanSendAsync for any message type that the actor handles. Here, the future output of send_async is a Result, because Actix may return an error. The error is converted to (), so that the caller does not need to be aware of Actix-specific error messages.

source§

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

Implementors§

source§

impl<A: AsRef<AsyncSender<M, R>> + Send + Sync + 'static, M: 'static, R: 'static> CanSendAsync<M, R> for A

source§

impl<M, R, S: CanSendAsync<M, R>> CanSendAsync<M, R> for LateBoundSender<S>

Allows LateBoundSender to be convertible to an AsyncSender as long as the inner object could be.

source§

impl<M, S> CanSendAsync<M, Result<<M as Message>::Result, ()>> for AddrWithAutoSpanContext<S>where M: Message + 'static, M::Result: Send, S: Actor, Addr<S>: CanSendAsync<WithSpanContext<M>, Result<M::Result, ()>>,