pub struct Routed<M> where
    M: Message
{ /* private fields */ }
Expand description

A message wrapper that provides message route information.

Workers can accept arbitrary message types, which may not contain information about their routes.

However, the Ockam worker and messaging system already keeps track of this information internally.

This type makes it possible to expose this information to the user, without requiring changes to the user’s message types.

Examples

See ockam_node::WorkerRelay for a usage example.

Implementations

Create a new Routed message wrapper from the given message, message address and a local message that contains routing information.

Return a copy of the message address.

Return a copy of the onward route for the wrapped message.

Return a copy of the full return route for the wrapped message.

Return a copy of the sender address for the wrapped message.

Consume the message wrapper and return the original message.

Return a reference to the wrapped message.

Consume the message wrapper and return the underlying local message.

Consume the message wrapper and return the underlying transport message.

Return a reference to the underlying local message.

Return a reference to the underlying transport message’s binary payload.

Consume the message wrapper and return the underlying transport message’s binary payload.

Try to cast an Any message into another valid message type

Trait Implementations

Formats the value using the given formatter. Read more

The resulting type after dereferencing.

Dereferences the value.

Mutably dereferences the value.

Formats the value using the given formatter. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more