pub struct Message<T: Actor> { /* private fields */ }Expand description
Internal channel envelope wrapping the user’s <T as Actor>::Message
plus an optional oneshot reply channel.
Users never construct this directly — send / send_and_recv wrap
the user’s message into a Message<T> before pushing it onto the
mailbox channel. Exposed so advanced callers can drive the mailbox
directly via handler_tx. (Not in the prelude — the name is too
close to Self::Message and would shadow user types.)
Clone is implemented but drops result_tx on the clone (you can’t
clone a oneshot sender). Clones therefore become fire-and-forget
envelopes regardless of the original’s reply channel.
Implementations§
Source§impl<T> Message<T>where
T: Actor,
impl<T> Message<T>where
T: Actor,
Sourcepub fn new(
inner: Arc<<T as Actor>::Message>,
result_tx: Option<Sender<<T as Actor>::Result>>,
) -> Self
pub fn new( inner: Arc<<T as Actor>::Message>, result_tx: Option<Sender<<T as Actor>::Result>>, ) -> Self
Build an envelope. result_tx = Some(_) makes the send wait for a
reply (send_and_recv flow); None is fire-and-forget (send).
Trait Implementations§
Auto Trait Implementations§
impl<T> !RefUnwindSafe for Message<T>
impl<T> !UnwindSafe for Message<T>
impl<T> Freeze for Message<T>
impl<T> Send for Message<T>
impl<T> Sync for Message<T>
impl<T> Unpin for Message<T>
impl<T> UnsafeUnpin for Message<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