Trait ethers_providers::JsonRpcClient
source · 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§
sourcetype Error: Into<ProviderError> + RpcError
type Error: Into<ProviderError> + RpcError
A JSON-RPC Error
Required Methods§
Object Safety§
This trait is not object safe.
Implementations on Foreign Types§
source§impl<'a, U: 'a + JsonRpcClient + ?Sized> JsonRpcClient for &'a U
impl<'a, U: 'a + JsonRpcClient + ?Sized> JsonRpcClient for &'a U
source§impl<U: JsonRpcClient + ?Sized> JsonRpcClient for Box<U>
impl<U: JsonRpcClient + ?Sized> JsonRpcClient for Box<U>
source§impl<U: JsonRpcClient + ?Sized> JsonRpcClient for Arc<U>
impl<U: JsonRpcClient + ?Sized> JsonRpcClient for Arc<U>
Implementors§
source§impl JsonRpcClient for Ws
Available on crate feature legacy-ws
only.
impl JsonRpcClient for Ws
Available on crate feature
legacy-ws
only.type Error = ClientError
source§impl JsonRpcClient for Provider
impl JsonRpcClient for Provider
type Error = ClientError
source§impl JsonRpcClient for Ipc
Available on crate feature ipc
and (Unix or Windows) only.
impl JsonRpcClient for Ipc
Available on crate feature
ipc
and (Unix or Windows) only.