Struct wasmbus_rpc::RpcClient[][src]

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

Send wasmbus rpc messages

The primary use of RpcClient is providers sending to actors, however providers don’t need to construct this - one is created by HostBridge, which providers create during initialization.

This class is also used by wash and test tools for sending rpc messages to actors and providers. Note that sending to a provider requires an existing link definition, and, the message needs to be signed by a valid cluster key.

This RpcClient does not subscribe to rpc topics. To subscribe, use the nats client api directly.

Implementations

Constructs a new RpcClient for the async nats connection. parameters: async nats client, lattice rpc prefix (usually “default”), and secret key for signing messages

Constructs a new RpcClient for a nats::asynk connection. parameters: async nats client, lattice rpc prefix (usually “default”), and secret key for signing messages

Send an rpc message using json-encoded data

Send an rpc message. target may be &str or String for sending to an actor, or a WasmCloudEntity (for actor or provider) If nats client is sync, this can block the current thread

Send nats request wait for response. If client is sync, this can block the current thread

Send nats message with no reply-to

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. 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.

Performs the conversion.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

Should always be Self

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. 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.