pub struct Mailbox<T: Message> { /* private fields */ }Expand description
A type-erased, cloneable handle for sending messages of type T to an actor.
Unlike Address<A>, Mailbox<T> is generic over the message type rather than the actor
type. This allows passing a mailbox to code that only needs to send a specific message type
without exposing the concrete actor A.
Construct a Mailbox<T> from an Address<A> via Address::into_mailbox.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Mailbox<T>
impl<T> !RefUnwindSafe for Mailbox<T>
impl<T> Send for Mailbox<T>
impl<T> Sync for Mailbox<T>
impl<T> Unpin for Mailbox<T>
impl<T> UnsafeUnpin for Mailbox<T>
impl<T> !UnwindSafe for Mailbox<T>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more