Struct wasmbus_rpc::RpcClientSync [−][src]
pub struct RpcClientSync { /* fields omitted */ }
Implementations
Constructs a new synchronous RpcClient parameters: nats client connection, lattice rpc prefix (usually “default”), and secret key for signing messages
pub async fn send_json<Target, Arg, Resp>(
&self,
origin: WasmCloudEntity,
target: Target,
method: &str,
data: JsonValue
) -> Result<JsonValue, RpcError> where
Arg: DeserializeOwned + Serialize,
Resp: DeserializeOwned + Serialize,
Target: Into<WasmCloudEntity>,
pub async fn send_json<Target, Arg, Resp>(
&self,
origin: WasmCloudEntity,
target: Target,
method: &str,
data: JsonValue
) -> Result<JsonValue, RpcError> where
Arg: DeserializeOwned + Serialize,
Resp: DeserializeOwned + Serialize,
Target: Into<WasmCloudEntity>,
Send an rpc message using json-encoded data. Blocks the current thread until response is received.
pub fn send<Target>(
&self,
origin: WasmCloudEntity,
target: Target,
message: Message<'_>
) -> Result<Vec<u8>, RpcError> where
Target: Into<WasmCloudEntity>,
pub fn send<Target>(
&self,
origin: WasmCloudEntity,
target: Target,
message: Message<'_>
) -> Result<Vec<u8>, RpcError> where
Target: Into<WasmCloudEntity>,
Send an rpc message. Blocks the current thread until response is received.
Methods from Deref<Target = RpcClient>
pub async fn send_json<Target, Arg, Resp>(
&self,
origin: WasmCloudEntity,
target: Target,
method: &str,
data: JsonValue
) -> Result<JsonValue, RpcError> where
Arg: DeserializeOwned + Serialize,
Resp: DeserializeOwned + Serialize,
Target: Into<WasmCloudEntity>,
pub async fn send_json<Target, Arg, Resp>(
&self,
origin: WasmCloudEntity,
target: Target,
method: &str,
data: JsonValue
) -> Result<JsonValue, RpcError> where
Arg: DeserializeOwned + Serialize,
Resp: DeserializeOwned + Serialize,
Target: Into<WasmCloudEntity>,
Send an rpc message using json-encoded data
pub async fn send<Target>(
&self,
origin: WasmCloudEntity,
target: Target,
message: Message<'_>
) -> Result<Vec<u8>, RpcError> where
Target: Into<WasmCloudEntity>,
pub async fn send<Target>(
&self,
origin: WasmCloudEntity,
target: Target,
message: Message<'_>
) -> Result<Vec<u8>, RpcError> where
Target: Into<WasmCloudEntity>,
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