Trait CanSend

Source
pub trait CanSend<M>:
    Send
    + Sync
    + 'static {
    // Required method
    fn send(&self, message: M);
}
Expand description

Trait for sending a typed message. The sent message is then handled by the Handler trait. actix::Addr, which is derived from actix::Actor is an example of a struct that implements CanSend. See Handler trait for more details.

Required Methods§

Source

fn send(&self, message: M)

Implementations on Foreign Types§

Source§

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

Source§

fn send(&self, message: MessageWithCallback<M, M::Result>)

Source§

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

An actix Addr implements CanSend for any message type that the actor handles.

Source§

fn send(&self, message: M)

Implementors§

Source§

impl<M> CanSend<M> for Noop

Source§

impl<M, A> CanSend<M> for TestLoopSender<A>
where M: Message + Debug + Send + 'static, A: Actor + HandlerWithContext<M> + 'static, M::Result: Send,

Source§

impl<M, R, A> CanSend<MessageWithCallback<M, R>> for TestLoopSender<A>
where M: Message<Result = R> + Debug + Send + 'static, A: Actor + HandlerWithContext<M> + 'static, R: 'static + Send,

Source§

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

Source§

impl<M, S> CanSend<M> for AddrWithAutoSpanContext<S>
where M: Message + 'static, S: Actor, Addr<S>: CanSend<WithSpanContext<M>>,

Source§

impl<M, S: CanSend<M>> CanSend<M> for LateBoundSender<S>

Allows LateBoundSender to be convertible to a Sender as long as the inner object could be.

Source§

impl<S, M: From<S> + 'static> CanSend<S> for BreakApart<M>