Trait actix::dev::MessageRecipient [−][src]
pub trait MessageRecipient<M>: Sized where
M: Message + 'static, { type Envelope: From<M>; type Transport; type SendError; type MailboxError; type Request: Future<Item = M::Result, Error = Self::MailboxError>; fn do_send(tx: &Self::Transport, msg: M) -> Result<(), Self::SendError>; fn try_send(tx: &Self::Transport, msg: M) -> Result<(), Self::SendError>; fn send(tx: &Self::Transport, msg: M) -> Self::Request; fn clone(tx: &Self::Transport) -> Self::Transport; }
Associated Types
type Envelope: From<M>
type Transport
type SendError
type MailboxError
type Request: Future<Item = M::Result, Error = Self::MailboxError>
Required Methods
fn do_send(tx: &Self::Transport, msg: M) -> Result<(), Self::SendError>
Send message unconditionally
Deliver message even if recipient's mailbox is full
fn try_send(tx: &Self::Transport, msg: M) -> Result<(), Self::SendError>
Try send message
This method fails if actor's mailbox is full or closed. This method register current task in receivers queue.
fn send(tx: &Self::Transport, msg: M) -> Self::Request
Send asynchronous message and wait for response.
Communication channel to the actor is bounded. if returned Receiver
object get dropped, message cancels.
fn clone(tx: &Self::Transport) -> Self::Transport
Clone transport
Implementors
impl<M> MessageRecipient<M> for Syn where
M: Message + Send + 'static,
M::Result: Send, type Transport = Box<SyncSender<M>>; type Envelope = SyncMessageEnvelope<M>; type SendError = SendError<M>; type MailboxError = MailboxError; type Request = SyncRecipientRequest<M>;impl<M> MessageRecipient<M> for Unsync where
M: Message + 'static, type Envelope = MessageEnvelope<M>; type Transport = Box<UnsyncSender<M>>; type SendError = SendError<M>; type MailboxError = MailboxError; type Request = UnsyncRecipientRequest<M>;