pub trait IpcClientExt: IpcClient {
// Provided methods
fn register_rpc_handler<H>(
&self,
handler: H,
) -> impl Future<Output = ()> + Send
where H: RpcHandler + Send + Sync + 'static { ... }
fn send_typed<Payload>(
&self,
payload: Payload,
destination: Endpoint,
) -> impl Future<Output = Result<(), RequestError>> + Send
where Payload: Serialize + PayloadTypeName + Send { ... }
fn subscribe_typed<Payload>(
&self,
) -> impl Future<Output = Result<IpcClientTypedSubscription<Payload>, SubscribeError>> + Send
where Payload: DeserializeOwned + PayloadTypeName { ... }
fn request<Request>(
&self,
request: Request,
destination: Endpoint,
cancellation_token: Option<CancellationToken>,
) -> impl Future<Output = Result<Request::Response, RequestError>> + Send
where Request: RpcRequest + Send,
Request::Response: Send { ... }
}Expand description
Provided Methods§
Sourcefn register_rpc_handler<H>(&self, handler: H) -> impl Future<Output = ()> + Send
fn register_rpc_handler<H>(&self, handler: H) -> impl Future<Output = ()> + Send
Register a new RPC handler for processing incoming RPC requests. The handler will be executed by the IPC client when an RPC request is received and the response will be sent back over IPC.
Sourcefn send_typed<Payload>(
&self,
payload: Payload,
destination: Endpoint,
) -> impl Future<Output = Result<(), RequestError>> + Send
fn send_typed<Payload>( &self, payload: Payload, destination: Endpoint, ) -> impl Future<Output = Result<(), RequestError>> + Send
Send a message with a payload of any serializable type to the specified destination.
Sourcefn subscribe_typed<Payload>(
&self,
) -> impl Future<Output = Result<IpcClientTypedSubscription<Payload>, SubscribeError>> + Sendwhere
Payload: DeserializeOwned + PayloadTypeName,
fn subscribe_typed<Payload>(
&self,
) -> impl Future<Output = Result<IpcClientTypedSubscription<Payload>, SubscribeError>> + Sendwhere
Payload: DeserializeOwned + PayloadTypeName,
Create a subscription to receive messages that can be deserialized into the provided payload type.
Sourcefn request<Request>(
&self,
request: Request,
destination: Endpoint,
cancellation_token: Option<CancellationToken>,
) -> impl Future<Output = Result<Request::Response, RequestError>> + Send
fn request<Request>( &self, request: Request, destination: Endpoint, cancellation_token: Option<CancellationToken>, ) -> impl Future<Output = Result<Request::Response, RequestError>> + Send
Send a request to the specified destination and wait for a response. The destination must have a registered RPC handler for the request type, otherwise an error will be returned by the remote endpoint.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.