Struct ockam_core::RelayMessage
source · pub struct RelayMessage { /* private fields */ }
Expand description
A message addressed to the relay responsible for delivery of the
wrapped LocalMessage
Implementations§
source§impl RelayMessage
impl RelayMessage
sourcepub fn new(
source: Address,
destination: Address,
local_msg: LocalMessage
) -> Self
pub fn new( source: Address, destination: Address, local_msg: LocalMessage ) -> Self
Construct a new message addressed to a user worker
sourcepub fn source(&self) -> &Address
pub fn source(&self) -> &Address
The sender address of the wrapped LocalMessage
Note that this may be different from the first hop in the return_route
This address is always equal to the address of the Context
instance used to
send or forward the message
sourcepub fn destination(&self) -> &Address
pub fn destination(&self) -> &Address
The recipient address for the wrapped LocalMessage
Note that this may be different from the first hop in the onward_route, for example while
sending a message to an External address (e.g. TCP) first message will be delivered to the
the TCP Router (and destination address will be the address of the TCP Router), and only
then to the individual connection worker
sourcepub fn onward_route(&self) -> &Route
pub fn onward_route(&self) -> &Route
Onward route
sourcepub fn return_route(&self) -> &Route
pub fn return_route(&self) -> &Route
Return route
sourcepub fn protocol_version(&self) -> ProtocolVersion
pub fn protocol_version(&self) -> ProtocolVersion
Protocol version
sourcepub fn local_message(&self) -> &LocalMessage
pub fn local_message(&self) -> &LocalMessage
Local message
sourcepub fn into_local_message(self) -> LocalMessage
pub fn into_local_message(self) -> LocalMessage
Take local message
Trait Implementations§
source§impl Clone for RelayMessage
impl Clone for RelayMessage
source§fn clone(&self) -> RelayMessage
fn clone(&self) -> RelayMessage
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more