pub struct Envelope<T: CallMsg> { /* private fields */ }
Expand description
Wraps a message to indicate if it was sent with call
or send
.
If the message was sent with call, then this enum will contain a channel that can be used to reply to it.
Implementations§
source§impl<T: CallMsg> Envelope<T>
impl<T: CallMsg> Envelope<T>
pub fn new(msg: T, reply: Option<Sender<T::Reply>>, from: ActorName) -> Self
sourcepub fn reply(&mut self, reply: T::Reply) -> Result<()>
pub fn reply(&mut self, reply: T::Reply) -> Result<()>
Sends a reply to this message.
If this message is not expecting a reply, or if this message has already been replied to, then an error is returned.
sourcepub fn needs_reply(&self) -> bool
pub fn needs_reply(&self) -> bool
Returns true if this message expects a reply and it has not already been replied to.
pub fn split(self) -> (T, Option<Sender<T::Reply>>, ActorName)
Auto Trait Implementations§
impl<T> !RefUnwindSafe for Envelope<T>
impl<T> Send for Envelope<T>
impl<T> Sync for Envelope<T>
impl<T> Unpin for Envelope<T>where T: Unpin,
impl<T> !UnwindSafe for Envelope<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