pub trait RpcClient: Send + Sync {
// Required methods
fn send_request<'life0, 'async_trait>(
&'life0 self,
req: Request,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn recv_response<'life0, 'async_trait>(
&'life0 self,
id: RequestId,
) -> Pin<Box<dyn Future<Output = Result<Response, Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn cancel<'life0, 'async_trait>(
&'life0 self,
cancel: Cancel,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn events(&self) -> Pin<Box<dyn Stream<Item = Event> + Send>>;
}Expand description
RPC client interface layered on a Session, with request/response correlation and cancellation.
Required Methods§
Sourcefn send_request<'life0, 'async_trait>(
&'life0 self,
req: Request,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn send_request<'life0, 'async_trait>(
&'life0 self,
req: Request,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Send a request; returns immediately after sending.
Sourcefn recv_response<'life0, 'async_trait>(
&'life0 self,
id: RequestId,
) -> Pin<Box<dyn Future<Output = Result<Response, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn recv_response<'life0, 'async_trait>(
&'life0 self,
id: RequestId,
) -> Pin<Box<dyn Future<Output = Result<Response, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Await a response with the given id.