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 moreAuto Trait Implementations§
impl Freeze for RelayMessage
impl RefUnwindSafe for RelayMessage
impl Send for RelayMessage
impl Sync for RelayMessage
impl Unpin for RelayMessage
impl UnwindSafe for RelayMessage
Blanket Implementations§
source§impl<D> AsyncTryClone for D
impl<D> AsyncTryClone for D
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)