pub struct Envelope<M = AnyMessage> { /* private fields */ }Implementations§
Source§impl<M> Envelope<M>where
M: Message,
impl<M> Envelope<M>where
M: Message,
pub fn into_erased(self) -> Envelope<AnyMessage>
Source§impl<M> Envelope<M>
impl<M> Envelope<M>
pub fn new(header: EnvelopeHeader, message: M) -> Self
pub fn header(&self) -> &EnvelopeHeader
Source§impl Envelope<AnyMessage>
impl Envelope<AnyMessage>
pub fn cast<M>(self) -> Result<Envelope<M>, Self>where
M: Message,
pub fn peek<M>(&self) -> Option<&M>where
M: Message,
pub fn is<M>(&self) -> boolwhere
M: Message,
pub fn tid(&self) -> TypeId
pub fn message_name(&self) -> &str
Sourcepub fn log_unhandled(&self)
pub fn log_unhandled(&self)
Log an unmatched message and drop it.
The dispatch! macro calls this for a message that no arm matched when
the match has no catch-all arm. The message is logged at WARN (with
its header and type name) and dropped — mirroring the fire-and-forget
semantics elsewhere in the runtime, so an unexpected message from any
peer no longer panics and kills the actor.
A dispatch! used in value position must supply its own catch-all arm,
because this fallback evaluates to ().
Trait Implementations§
Auto Trait Implementations§
impl<M> Freeze for Envelope<M>where
M: Freeze,
impl<M> RefUnwindSafe for Envelope<M>where
M: RefUnwindSafe,
impl<M> Send for Envelope<M>where
M: Send,
impl<M> Sync for Envelope<M>where
M: Sync,
impl<M> Unpin for Envelope<M>where
M: Unpin,
impl<M> UnsafeUnpin for Envelope<M>where
M: UnsafeUnpin,
impl<M> UnwindSafe for Envelope<M>where
M: UnwindSafe,
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