Trait jsonrpsee_core::client::ClientT
source · [−]pub trait ClientT {
fn notification<'a, 'life0, 'async_trait>(
&'life0 self,
method: &'a str,
params: Option<ParamsSer<'a>>
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where
'a: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait;
fn request<'a, 'life0, 'async_trait, R>(
&'life0 self,
method: &'a str,
params: Option<ParamsSer<'a>>
) -> Pin<Box<dyn Future<Output = Result<R, Error>> + Send + 'async_trait>>
where
R: DeserializeOwned,
'a: 'async_trait,
R: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait;
fn batch_request<'a, 'life0, 'async_trait, R>(
&'life0 self,
batch: Vec<(&'a str, Option<ParamsSer<'a>>)>
) -> Pin<Box<dyn Future<Output = Result<Vec<R>, Error>> + Send + 'async_trait>>
where
R: DeserializeOwned + Default + Clone,
'a: 'async_trait,
R: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait;
}
Available on crate feature
client
only.Expand description
JSON-RPC client interface that can make requests and notifications.
Required Methods
Send a notification request
Send a method call request.
fn batch_request<'a, 'life0, 'async_trait, R>(
&'life0 self,
batch: Vec<(&'a str, Option<ParamsSer<'a>>)>
) -> Pin<Box<dyn Future<Output = Result<Vec<R>, Error>> + Send + 'async_trait>> where
R: DeserializeOwned + Default + Clone,
'a: 'async_trait,
R: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
fn batch_request<'a, 'life0, 'async_trait, R>(
&'life0 self,
batch: Vec<(&'a str, Option<ParamsSer<'a>>)>
) -> Pin<Box<dyn Future<Output = Result<Vec<R>, Error>> + Send + 'async_trait>> where
R: DeserializeOwned + Default + Clone,
'a: 'async_trait,
R: 'async_trait,
'life0: 'async_trait,
Self: '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 successfully.
Returns Error
if any of the requests in batch fails.