Trait ethers::providers::JsonRpcClient [−][src]
pub trait JsonRpcClient: Debug + Send + Sync {
type Error: Error + Into<ProviderError>;
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, Global>>
where
'life0: 'async_trait,
'life1: 'async_trait,
T: Debug + Serialize + Send + Sync + 'async_trait,
R: DeserializeOwned + 'async_trait,
Self: 'async_trait;
}
Expand description
Trait which must be implemented by data transports to be used with the Ethereum JSON-RPC provider.
Associated Types
type Error: Error + Into<ProviderError>
type Error: Error + Into<ProviderError>
A JSON-RPC Error
Required methods
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, Global>> where
'life0: 'async_trait,
'life1: 'async_trait,
T: Debug + Serialize + Send + Sync + 'async_trait,
R: DeserializeOwned + 'async_trait,
Self: 'async_trait,
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, Global>> where
'life0: 'async_trait,
'life1: 'async_trait,
T: Debug + Serialize + Send + Sync + 'async_trait,
R: DeserializeOwned + 'async_trait,
Self: 'async_trait,
Sends a request with the provided JSON-RPC and parameters serialized as JSON