pub struct Routed<M> where
M: Message, { /* private fields */ }
Expand description
A message wrapper that stores message route information
Workers can accept arbitrary message types, which may not contain information about their routes. However, the ockam worker & messaging system already keeps track of this information internally. This type exposes this information to the user, without requiring changes in the user message types.
Implementations
sourceimpl<M> Routed<M> where
M: Message,
impl<M> Routed<M> where
M: Message,
sourcepub fn new(inner: M, msg_addr: Address, local_msg: LocalMessage) -> Routed<M>
pub fn new(inner: M, msg_addr: Address, local_msg: LocalMessage) -> Routed<M>
Create a new Routed message wrapper
sourcepub fn onward_route(&self) -> Route
pub fn onward_route(&self) -> Route
Return a copy of the onward route for this message
sourcepub fn return_route(&self) -> Route
pub fn return_route(&self) -> Route
Return a copy of the full return route of the wrapped message
sourcepub fn into_local_message(self) -> LocalMessage
pub fn into_local_message(self) -> LocalMessage
Consume the message wrapper to the underlying local message
sourcepub fn into_transport_message(self) -> TransportMessage
pub fn into_transport_message(self) -> TransportMessage
Consume the message wrapper to the underlying transport message
sourcepub fn local_message(&self) -> &LocalMessage
pub fn local_message(&self) -> &LocalMessage
Consume the message wrapper to the underlying local message
Trait Implementations
Auto Trait Implementations
impl<M> RefUnwindSafe for Routed<M> where
M: RefUnwindSafe,
impl<M> Send for Routed<M>
impl<M> Sync for Routed<M> where
M: Sync,
impl<M> Unpin for Routed<M> where
M: Unpin,
impl<M> UnwindSafe for Routed<M> where
M: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
fn instrument(self, span: Span) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
T: Future, type Output = <T as Future>::Output;
sourcefn in_current_span(self) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
fn in_current_span(self) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
T: Future, type Output = <T as Future>::Output;
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>impl<T> Future for WithDispatch<T> where
T: Future, type Output = <T as Future>::Output;
where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>impl<T> Future for WithDispatch<T> where
T: Future, type Output = <T as Future>::Output;
where
S: Into<Dispatch>,
T: Future, type Output = <T as Future>::Output;
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>impl<T> Future for WithDispatch<T> where
T: Future, type Output = <T as Future>::Output;
fn with_current_subscriber(self) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>impl<T> Future for WithDispatch<T> where
T: Future, type Output = <T as Future>::Output;
T: Future, type Output = <T as Future>::Output;
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more