Trait jsonrpsee_core::client::ClientT
source · pub trait ClientT {
// Required methods
fn notification<'life0, 'life1, 'async_trait, Params>(
&'life0 self,
method: &'life1 str,
params: Params
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Params: ToRpcParams + Send + 'async_trait,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn request<'life0, 'life1, 'async_trait, R, Params>(
&'life0 self,
method: &'life1 str,
params: Params
) -> Pin<Box<dyn Future<Output = Result<R, Error>> + Send + 'async_trait>>
where R: DeserializeOwned + 'async_trait,
Params: ToRpcParams + Send + 'async_trait,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn batch_request<'a, 'life0, 'async_trait, R>(
&'life0 self,
batch: BatchRequestBuilder<'a>
) -> Pin<Box<dyn Future<Output = Result<BatchResponse<'a, R>, Error>> + Send + 'async_trait>>
where R: DeserializeOwned + Debug + 'a + 'async_trait,
Self: 'async_trait,
'a: 'async_trait,
'life0: 'async_trait;
}
Expand description
JSON-RPC client interface that can make requests and notifications.
Required Methods§
sourcefn notification<'life0, 'life1, 'async_trait, Params>(
&'life0 self,
method: &'life1 str,
params: Params
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Params: ToRpcParams + Send + 'async_trait,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn notification<'life0, 'life1, 'async_trait, Params>( &'life0 self, method: &'life1 str, params: Params ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where Params: ToRpcParams + Send + 'async_trait, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,
Send a notification request
sourcefn request<'life0, 'life1, 'async_trait, R, Params>(
&'life0 self,
method: &'life1 str,
params: Params
) -> Pin<Box<dyn Future<Output = Result<R, Error>> + Send + 'async_trait>>where
R: DeserializeOwned + 'async_trait,
Params: ToRpcParams + Send + 'async_trait,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn request<'life0, 'life1, 'async_trait, R, Params>( &'life0 self, method: &'life1 str, params: Params ) -> Pin<Box<dyn Future<Output = Result<R, Error>> + Send + 'async_trait>>where R: DeserializeOwned + 'async_trait, Params: ToRpcParams + Send + 'async_trait, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,
Send a method call request.
sourcefn batch_request<'a, 'life0, 'async_trait, R>(
&'life0 self,
batch: BatchRequestBuilder<'a>
) -> Pin<Box<dyn Future<Output = Result<BatchResponse<'a, R>, Error>> + Send + 'async_trait>>where
R: DeserializeOwned + Debug + 'a + 'async_trait,
Self: 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
fn batch_request<'a, 'life0, 'async_trait, R>( &'life0 self, batch: BatchRequestBuilder<'a> ) -> Pin<Box<dyn Future<Output = Result<BatchResponse<'a, R>, Error>> + Send + 'async_trait>>where R: DeserializeOwned + Debug + 'a + 'async_trait, Self: 'async_trait, 'a: 'async_trait, 'life0: 'async_trait,
Send a batch request.
The response to batch are returned in the same order as it was inserted in the batch.
Returns Ok
if all requests in the batch were answered.
Returns Error
if the network failed or any of the responses could be parsed a valid JSON-RPC response.