pub struct RemoteMessage {
pub actor_id: u64,
pub message_id: u64,
pub message: Bytes,
pub result_tx: Option<Sender<Bytes>>,
pub decode_context: Option<DecodeContext>,
}Expand description
A unified remote message used for communication with remote actors.
This is used both for outbound messages (sent by an actor in the current process to an actor
in a remote process through Session) and for inbound messages
(received by a Session and forwarded to an actor in the current
process for handling).
Fields§
§actor_id: u64§message_id: u64§message: Bytes§result_tx: Option<Sender<Bytes>>§decode_context: Option<DecodeContext>Implementations§
Source§impl RemoteMessage
impl RemoteMessage
Sourcepub fn do_send(actor_id: u64, message_id: u64, message: Bytes) -> Self
pub fn do_send(actor_id: u64, message_id: u64, message: Bytes) -> Self
Constructs a new RemoteMessage which does not expect a response.
Sourcepub fn send(
actor_id: u64,
message_id: u64,
message: Bytes,
tx: Sender<Bytes>,
) -> Self
pub fn send( actor_id: u64, message_id: u64, message: Bytes, tx: Sender<Bytes>, ) -> Self
Constructs a new RemoteMessage which expects a response.
Sourcepub fn with_context(self, context: DecodeContext) -> Self
pub fn with_context(self, context: DecodeContext) -> Self
Sets the decode context on this message.
Trait Implementations§
Source§impl Debug for RemoteMessage
impl Debug for RemoteMessage
Source§impl Handler<RemoteMessage> for Session
impl Handler<RemoteMessage> for Session
Auto Trait Implementations§
impl !Freeze for RemoteMessage
impl !RefUnwindSafe for RemoteMessage
impl Send for RemoteMessage
impl Sync for RemoteMessage
impl Unpin for RemoteMessage
impl UnsafeUnpin for RemoteMessage
impl !UnwindSafe for RemoteMessage
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