Trait substrate_rpc_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 '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>>
       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>>
       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§

source

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 'life0: 'async_trait, 'life1: 'async_trait, Params: ToRpcParams + Send + 'async_trait, Self: 'async_trait,

source

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

source

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 '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.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<B, S> ClientT for HttpClient<S>
where S: Send + Sync + Clone + Service<Request<Body>, Response = Response<B>, Error = Error>, <S as Service<Request<Body>>>::Future: Send, B: Body<Data = Bytes> + Send + Unpin + 'static, <B as Body>::Error: Into<Box<dyn Error + Send + Sync>>, <B as Body>::Data: Send,

source§

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 'life0: 'async_trait, 'life1: 'async_trait, Params: ToRpcParams + Send + 'async_trait, HttpClient<S>: 'async_trait,

source§

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

source§

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 'a: 'async_trait, 'life0: 'async_trait, R: DeserializeOwned + Debug + 'a + 'async_trait, HttpClient<S>: 'async_trait,

Implementors§