Trait jsonrpsee_types::traits::Client[][src]

pub trait Client {
    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
; }
Expand description

JSON-RPC client interface that can make requests and notifications.

Required methods

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.

Implementors