Struct ethers_providers::Http [−][src]
pub struct Http { /* fields omitted */ }Expand description
A low-level JSON-RPC Client over HTTP.
Example
use ethers_core::types::U64;
use ethers_providers::{JsonRpcClient, Http};
use std::str::FromStr;
let provider = Http::from_str("http://localhost:8545")?;
let block_number: U64 = provider.request("eth_blockNumber", ()).await?;Implementations
Trait Implementations
fn request<'life0, 'life1, 'async_trait, T: Serialize + Send + Sync, R: DeserializeOwned>(
&'life0 self,
method: &'life1 str,
params: T
) -> Pin<Box<dyn Future<Output = Result<R, ClientError>> + Send + 'async_trait>> where
T: 'async_trait,
R: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn request<'life0, 'life1, 'async_trait, T: Serialize + Send + Sync, R: DeserializeOwned>(
&'life0 self,
method: &'life1 str,
params: T
) -> Pin<Box<dyn Future<Output = Result<R, ClientError>> + Send + 'async_trait>> where
T: 'async_trait,
R: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Sends a POST request with the provided method and the params serialized as JSON over HTTP
type Error = ClientError
type Error = ClientError
A JSON-RPC Error
Auto Trait Implementations
impl !RefUnwindSafe for Provider
impl !UnwindSafe for Provider
Blanket Implementations
Mutably borrows from an owned value. Read more
Instruments this type with the provided Span, returning an
Instrumented wrapper. Read more
Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more