pub trait JsonRpcClient: Debug + Send + Sync {
    type Error: Into<ProviderError> + RpcError;

    // Required method
    fn request<'life0, 'life1, 'async_trait, T, R>(
        &'life0 self,
        method: &'life1 str,
        params: T
    ) -> Pin<Box<dyn Future<Output = Result<R, Self::Error>> + Send + 'async_trait>>
       where T: Debug + Serialize + Send + Sync + 'async_trait,
             R: DeserializeOwned + Send + 'async_trait,
             Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Trait which must be implemented by data transports to be used with the Ethereum JSON-RPC provider.

Required Associated Types§

source

type Error: Into<ProviderError> + RpcError

A JSON-RPC Error

Required Methods§

source

fn request<'life0, 'life1, 'async_trait, T, R>( &'life0 self, method: &'life1 str, params: T ) -> Pin<Box<dyn Future<Output = Result<R, Self::Error>> + Send + 'async_trait>>
where T: Debug + Serialize + Send + Sync + 'async_trait, R: DeserializeOwned + Send + 'async_trait, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Sends a request with the provided JSON-RPC and parameters serialized as JSON

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<'a, U: 'a + JsonRpcClient + ?Sized> JsonRpcClient for &'a U
where &'a U: Debug + Send + Sync,

§

type Error = <U as JsonRpcClient>::Error

source§

fn request<'life0, 'life1, 'async_trait, T, R>( &'life0 self, method: &'life1 str, params: T ) -> Pin<Box<dyn Future<Output = Result<R, Self::Error>> + Send + 'async_trait>>
where T: Debug + Serialize + Send + Sync + 'async_trait, R: DeserializeOwned + Send + 'async_trait, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source§

impl<U: JsonRpcClient + ?Sized> JsonRpcClient for Box<U>
where Box<U>: Debug + Send + Sync,

§

type Error = <U as JsonRpcClient>::Error

source§

fn request<'life0, 'life1, 'async_trait, T, R>( &'life0 self, method: &'life1 str, params: T ) -> Pin<Box<dyn Future<Output = Result<R, Self::Error>> + Send + 'async_trait>>
where T: Debug + Serialize + Send + Sync + 'async_trait, R: DeserializeOwned + Send + 'async_trait, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source§

impl<U: JsonRpcClient + ?Sized> JsonRpcClient for Arc<U>
where Arc<U>: Debug + Send + Sync,

§

type Error = <U as JsonRpcClient>::Error

source§

fn request<'life0, 'life1, 'async_trait, T, R>( &'life0 self, method: &'life1 str, params: T ) -> Pin<Box<dyn Future<Output = Result<R, Self::Error>> + Send + 'async_trait>>
where T: Debug + Serialize + Send + Sync + 'async_trait, R: DeserializeOwned + Send + 'async_trait, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Implementors§

source§

impl JsonRpcClient for Ws

Available on crate feature legacy-ws only.
source§

impl JsonRpcClient for Provider

source§

impl JsonRpcClient for Ipc

Available on crate feature ipc and (Unix or Windows) only.
source§

impl JsonRpcClient for MockProvider

source§

impl<C> JsonRpcClient for QuorumProvider<C>

source§

impl<Read, Write> JsonRpcClient for RwClient<Read, Write>
where Read: JsonRpcClient + 'static, <Read as JsonRpcClient>::Error: Sync + Send + 'static, Write: JsonRpcClient + 'static, <Write as JsonRpcClient>::Error: Sync + Send + 'static,

§

type Error = RwClientError<Read, Write>

source§

impl<T> JsonRpcClient for RetryClient<T>
where T: JsonRpcClient + 'static, T::Error: Sync + Send + 'static,