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, Global>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             Params: ToRpcParams + Send + 'async_trait,
             Self: '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, Global>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             R: DeserializeOwned + 'async_trait,
             Params: ToRpcParams + Send + 'async_trait,
             Self: '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, Global>>
       where 'a: 'async_trait,
             'life0: 'async_trait,
             R: DeserializeOwned + Debug + 'a + 'async_trait,
             Self: 'async_trait;
}
Expand description

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

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, Global>>where 'life0: 'async_trait, 'life1: 'async_trait, Params: ToRpcParams + Send + 'async_trait, Self: '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, Global>>where 'life0: 'async_trait, 'life1: 'async_trait, R: DeserializeOwned + 'async_trait, Params: ToRpcParams + Send + 'async_trait, Self: '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, Global>>where 'a: 'async_trait, 'life0: 'async_trait, R: DeserializeOwned + Debug + 'a + '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. Returns Error if the network failed or any of the responses could be parsed a valid JSON-RPC response.

Implementations on Foreign Types§

§

impl ClientT for HttpClient

§

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, Global>>where 'life0: 'async_trait, 'life1: 'async_trait, R: DeserializeOwned + 'async_trait, Params: ToRpcParams + Send + 'async_trait, HttpClient: 'async_trait,

Perform a request towards the server.

§

fn notification<'life0, 'life1, 'async_trait, Params>( &'life0 self, method: &'life1 str, params: Params ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait, Global>>where 'life0: 'async_trait, 'life1: 'async_trait, Params: ToRpcParams + Send + 'async_trait, HttpClient: '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, Global>>where 'a: 'async_trait, 'life0: 'async_trait, R: DeserializeOwned + Debug + 'a + 'async_trait, HttpClient: 'async_trait,

Implementors§

§

impl ClientT for Client