Struct ockam_node::Context[][src]

pub struct Context { /* fields omitted */ }
Expand description

Context contains Node state and references to the runtime.

Implementations

Return runtime clone

Return the primary worker address

Return all addresses of this worker

Create a new context without spawning a full worker

Start a new worker handle at Address

Signal to the local application runner to shut down

Shut down a worker by its primary address

Send a message via a fully qualified route

Routes can be constructed from a set of Addresses, or via the RouteBuilder type. Routes can contain middleware router addresses, which will re-address messages that need to be handled by specific domain workers.

Send a message via a fully qualified route using specific Worker address

Routes can be constructed from a set of Addresses, or via the RouteBuilder type. Routes can contain middleware router addresses, which will re-address messages that need to be handled by specific domain workers.

Forward a transport message to its next routing destination

Similar to [Context::send_message], but taking a TransportMessage, which contains the full destination route, and calculated return route for this hop.

Note: you most likely want to use [Context::send_message] instead, unless you are writing an external router implementation for ockam node.

Block the current worker to wait for a typed message

This function may return a Err(FailedLoadData) if the underlying worker was shut down, or Err(Timeout) if the call was waiting for longer than the default timeout. Use receive_timeout to adjust the timeout period.

Will return None if the corresponding worker has been stopped, or the underlying Node has shut down.

Block to wait for a typed message, with explicit timeout

Block the current worker to wait for a message satisfying a conditional

Will return Err if the corresponding worker has been stopped, or the underlying node has shut down. This operation has a default timeout.

Internally this function calls receive and .cancel() in a loop until a matching message is found.

Return a list of all available worker addresses on a node

Register a router for a specific address type

Trait Implementations

Executes the destructor for this type. Read more

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

Performs the conversion.

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

Performs the conversion.

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.