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
Self: 'async_trait,
'a: 'async_trait,
'life0: '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 + 'async_trait,
Self: 'async_trait,
'a: 'async_trait,
'life0: '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 + '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<'a, 'life0, 'async_trait>(
&'life0 self,
method: &'a str,
params: Option<ParamsSer<'a>>
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
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
Self: 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
Send a notification request
sourcefn 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 + 'async_trait,
Self: 'async_trait,
'a: 'async_trait,
'life0: '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 + 'async_trait,
Self: 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
Send a method call request.
sourcefn 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 + 'async_trait,
Self: 'async_trait,
'a: 'async_trait,
'life0: '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 + '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 successfully.
Returns Error
if any of the requests in batch fails.