Struct ethers_providers::Provider [−][src]
An abstract provider for interacting with the Ethereum JSON RPC
API. Must be instantiated
with a data transport which implements the JsonRpcClient trait
(e.g. HTTP, Websockets etc.)
Example
use ethers::providers::{Middleware, Provider, Http}; use std::convert::TryFrom; let provider = Provider::<Http>::try_from( "https://mainnet.infura.io/v3/c60b0bb42f8a4c6481ecd229eddaca27" ).expect("could not instantiate HTTP Provider"); let block = provider.get_block(100u64).await?; println!("Got block: {}", serde_json::to_string(&block)?);
Implementations
impl<P: JsonRpcClient> Provider<P>[src]
pub fn new(provider: P) -> Self[src]
Instantiate a new provider with a backend.
pub fn with_sender(self, address: impl Into<Address>) -> Self[src]
impl<P: JsonRpcClient> Provider<P>[src]
pub fn ens<T: Into<Address>>(self, ens: T) -> Self[src]
Sets the ENS Address (default: mainnet)
pub fn interval<T: Into<Duration>>(self, interval: T) -> Self[src]
Sets the default polling interval for event filters and pending transactions (default: 7 seconds)
pub fn get_interval(&self) -> Duration[src]
Gets the polling interval which the provider currently uses for event filters and pending transactions (default: 7 seconds)
impl Provider<Ws>[src]
pub async fn connect(
url: impl IntoClientRequest + Unpin
) -> Result<Self, ProviderError>[src]
url: impl IntoClientRequest + Unpin
) -> Result<Self, ProviderError>
Direct connection to a websocket endpoint
impl Provider<MockProvider>[src]
pub fn mocked() -> (Self, MockProvider)[src]
Returns a Provider instantiated with an internal “mock” transport.
Example
use ethers::{types::U64, providers::{Middleware, Provider}}; // Instantiate the provider let (provider, mock) = Provider::mocked(); // Push the mock response mock.push(U64::from(12))?; // Make the call let blk = provider.get_block_number().await.unwrap(); // The response matches assert_eq!(blk.as_u64(), 12); // and the request as well! mock.assert_request("eth_blockNumber", ()).unwrap();
Trait Implementations
impl<P> AsRef<P> for Provider<P>[src]
impl<P: Clone> Clone for Provider<P>[src]
impl<P: Debug> Debug for Provider<P>[src]
impl<P: JsonRpcClient> Middleware for Provider<P>[src]
type Error = ProviderError
type Provider = P
type Inner = Self
fn inner(&self) -> &Self::Inner[src]
fn provider(&self) -> &Provider<Self::Provider>[src]
fn get_block_number<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<U64, ProviderError>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait, [src]
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<U64, ProviderError>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Gets the latest block number via the eth_BlockNumber API
fn get_block<'life0, 'async_trait, T: Into<BlockId> + Send + Sync>(
&'life0 self,
block_hash_or_number: T
) -> Pin<Box<dyn Future<Output = Result<Option<Block<TxHash>>, Self::Error>> + Send + 'async_trait>> where
T: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait, [src]
&'life0 self,
block_hash_or_number: T
) -> Pin<Box<dyn Future<Output = Result<Option<Block<TxHash>>, Self::Error>> + Send + 'async_trait>> where
T: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
Gets the block at block_hash_or_number (transaction hashes only)
fn get_block_with_txs<'life0, 'async_trait, T: Into<BlockId> + Send + Sync>(
&'life0 self,
block_hash_or_number: T
) -> Pin<Box<dyn Future<Output = Result<Option<Block<Transaction>>, ProviderError>> + Send + 'async_trait>> where
T: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait, [src]
&'life0 self,
block_hash_or_number: T
) -> Pin<Box<dyn Future<Output = Result<Option<Block<Transaction>>, ProviderError>> + Send + 'async_trait>> where
T: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
Gets the block at block_hash_or_number (full transactions included)
fn get_transaction<'life0, 'async_trait, T: Send + Sync + Into<TxHash>>(
&'life0 self,
transaction_hash: T
) -> Pin<Box<dyn Future<Output = Result<Option<Transaction>, ProviderError>> + Send + 'async_trait>> where
T: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait, [src]
&'life0 self,
transaction_hash: T
) -> Pin<Box<dyn Future<Output = Result<Option<Transaction>, ProviderError>> + Send + 'async_trait>> where
T: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
Gets the transaction with transaction_hash
fn get_transaction_receipt<'life0, 'async_trait, T: Send + Sync + Into<TxHash>>(
&'life0 self,
transaction_hash: T
) -> Pin<Box<dyn Future<Output = Result<Option<TransactionReceipt>, ProviderError>> + Send + 'async_trait>> where
T: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait, [src]
&'life0 self,
transaction_hash: T
) -> Pin<Box<dyn Future<Output = Result<Option<TransactionReceipt>, ProviderError>> + Send + 'async_trait>> where
T: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
Gets the transaction receipt with transaction_hash
fn get_gas_price<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<U256, ProviderError>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait, [src]
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<U256, ProviderError>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Gets the current gas price as estimated by the node
fn get_accounts<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Vec<Address>, ProviderError>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait, [src]
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Vec<Address>, ProviderError>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Gets the accounts on the node
fn get_transaction_count<'life0, 'async_trait, T: Into<NameOrAddress> + Send + Sync>(
&'life0 self,
from: T,
block: Option<BlockNumber>
) -> Pin<Box<dyn Future<Output = Result<U256, ProviderError>> + Send + 'async_trait>> where
T: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait, [src]
&'life0 self,
from: T,
block: Option<BlockNumber>
) -> Pin<Box<dyn Future<Output = Result<U256, ProviderError>> + Send + 'async_trait>> where
T: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
Returns the nonce of the address
fn get_balance<'life0, 'async_trait, T: Into<NameOrAddress> + Send + Sync>(
&'life0 self,
from: T,
block: Option<BlockNumber>
) -> Pin<Box<dyn Future<Output = Result<U256, ProviderError>> + Send + 'async_trait>> where
T: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait, [src]
&'life0 self,
from: T,
block: Option<BlockNumber>
) -> Pin<Box<dyn Future<Output = Result<U256, ProviderError>> + Send + 'async_trait>> where
T: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
Returns the account’s balance
fn get_chainid<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<U256, ProviderError>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait, [src]
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<U256, ProviderError>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Returns the currently configured chain id, a value used in replay-protected transaction signing as introduced by EIP-155.
fn call<'life0, 'life1, 'async_trait>(
&'life0 self,
tx: &'life1 TransactionRequest,
block: Option<BlockNumber>
) -> Pin<Box<dyn Future<Output = Result<Bytes, ProviderError>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait, [src]
&'life0 self,
tx: &'life1 TransactionRequest,
block: Option<BlockNumber>
) -> Pin<Box<dyn Future<Output = Result<Bytes, ProviderError>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Sends the read-only (constant) transaction to a single Ethereum node and return the result (as bytes) of executing it. This is free, since it does not change any state on the blockchain.
fn estimate_gas<'life0, 'life1, 'async_trait>(
&'life0 self,
tx: &'life1 TransactionRequest
) -> Pin<Box<dyn Future<Output = Result<U256, ProviderError>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait, [src]
&'life0 self,
tx: &'life1 TransactionRequest
) -> Pin<Box<dyn Future<Output = Result<U256, ProviderError>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Sends a transaction to a single Ethereum node and return the estimated amount of gas required (as a U256) to send it This is free, but only an estimate. Providing too little gas will result in a transaction being rejected (while still consuming all provided gas).
fn send_transaction<'life0, 'async_trait>(
&'life0 self,
tx: TransactionRequest,
__arg2: Option<BlockNumber>
) -> Pin<Box<dyn Future<Output = Result<PendingTransaction<'_, P>, ProviderError>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait, [src]
&'life0 self,
tx: TransactionRequest,
__arg2: Option<BlockNumber>
) -> Pin<Box<dyn Future<Output = Result<PendingTransaction<'_, P>, ProviderError>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Sends the transaction to the entire Ethereum network and returns the transaction’s hash This will consume gas from the account that signed the transaction.
fn send_raw_transaction<'a, 'life0, 'async_trait>(
&'a self,
tx: &'life0 Transaction
) -> Pin<Box<dyn Future<Output = Result<PendingTransaction<'a, P>, ProviderError>> + Send + 'async_trait>> where
'a: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait, [src]
&'a self,
tx: &'life0 Transaction
) -> Pin<Box<dyn Future<Output = Result<PendingTransaction<'a, P>, ProviderError>> + Send + 'async_trait>> where
'a: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
Send the raw RLP encoded transaction to the entire Ethereum network and returns the transaction’s hash This will consume gas from the account that signed the transaction.
fn is_signer<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait, [src]
&'life0 self
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
The JSON-RPC provider is at the bottom-most position in the middleware stack. Here we check
if it has the key for the sender address unlocked, as well as supports the eth_sign call.
fn sign<'life0, 'life1, 'async_trait, T: Into<Bytes> + Send + Sync>(
&'life0 self,
data: T,
from: &'life1 Address
) -> Pin<Box<dyn Future<Output = Result<Signature, ProviderError>> + Send + 'async_trait>> where
T: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait, [src]
&'life0 self,
data: T,
from: &'life1 Address
) -> Pin<Box<dyn Future<Output = Result<Signature, ProviderError>> + Send + 'async_trait>> where
T: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Signs data using a specific account. This account needs to be unlocked.
fn get_logs<'life0, 'life1, 'async_trait>(
&'life0 self,
filter: &'life1 Filter
) -> Pin<Box<dyn Future<Output = Result<Vec<Log>, ProviderError>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait, [src]
&'life0 self,
filter: &'life1 Filter
) -> Pin<Box<dyn Future<Output = Result<Vec<Log>, ProviderError>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Returns an array (possibly empty) of logs that match the filter
fn watch<'a, 'life0, 'async_trait>(
&'a self,
filter: &'life0 Filter
) -> Pin<Box<dyn Future<Output = Result<FilterWatcher<'a, P, Log>, ProviderError>> + Send + 'async_trait>> where
'a: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait, [src]
&'a self,
filter: &'life0 Filter
) -> Pin<Box<dyn Future<Output = Result<FilterWatcher<'a, P, Log>, ProviderError>> + Send + 'async_trait>> where
'a: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
Streams matching filter logs
fn watch_blocks<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<FilterWatcher<'_, P, H256>, ProviderError>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait, [src]
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<FilterWatcher<'_, P, H256>, ProviderError>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Streams new block hashes
fn watch_pending_transactions<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<FilterWatcher<'_, P, H256>, ProviderError>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait, [src]
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<FilterWatcher<'_, P, H256>, ProviderError>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Streams pending transactions
fn new_filter<'life0, 'life1, 'async_trait>(
&'life0 self,
filter: FilterKind<'life1>
) -> Pin<Box<dyn Future<Output = Result<U256, ProviderError>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait, [src]
&'life0 self,
filter: FilterKind<'life1>
) -> Pin<Box<dyn Future<Output = Result<U256, ProviderError>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Creates a filter object, based on filter options, to notify when the state changes (logs).
To check if the state has changed, call get_filter_changes with the filter id.
fn uninstall_filter<'life0, 'async_trait, T: Into<U256> + Send + Sync>(
&'life0 self,
id: T
) -> Pin<Box<dyn Future<Output = Result<bool, ProviderError>> + Send + 'async_trait>> where
T: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait, [src]
&'life0 self,
id: T
) -> Pin<Box<dyn Future<Output = Result<bool, ProviderError>> + Send + 'async_trait>> where
T: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
Uninstalls a filter
fn get_filter_changes<'life0, 'async_trait, T, R>(
&'life0 self,
id: T
) -> Pin<Box<dyn Future<Output = Result<Vec<R>, ProviderError>> + Send + 'async_trait>> where
T: Into<U256> + Send + Sync,
R: Serialize + DeserializeOwned + Send + Sync + Debug,
T: 'async_trait,
R: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait, [src]
&'life0 self,
id: T
) -> Pin<Box<dyn Future<Output = Result<Vec<R>, ProviderError>> + Send + 'async_trait>> where
T: Into<U256> + Send + Sync,
R: Serialize + DeserializeOwned + Send + Sync + Debug,
T: 'async_trait,
R: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
Polling method for a filter, which returns an array of logs which occurred since last poll.
This method must be called with one of the following return types, depending on the filter type:
eth_newBlockFilter:H256, returns block hasheseth_newPendingTransactionFilter:H256, returns transaction hasheseth_newFilter:Log, returns raw logs
If one of these types is not used, decoding will fail and the method will return an error.
fn get_storage_at<'life0, 'async_trait, T: Into<NameOrAddress> + Send + Sync>(
&'life0 self,
from: T,
location: H256,
block: Option<BlockNumber>
) -> Pin<Box<dyn Future<Output = Result<H256, ProviderError>> + Send + 'async_trait>> where
T: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait, [src]
&'life0 self,
from: T,
location: H256,
block: Option<BlockNumber>
) -> Pin<Box<dyn Future<Output = Result<H256, ProviderError>> + Send + 'async_trait>> where
T: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
Get the storage of an address for a particular slot location
fn get_code<'life0, 'async_trait, T: Into<NameOrAddress> + Send + Sync>(
&'life0 self,
at: T,
block: Option<BlockNumber>
) -> Pin<Box<dyn Future<Output = Result<Bytes, ProviderError>> + Send + 'async_trait>> where
T: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait, [src]
&'life0 self,
at: T,
block: Option<BlockNumber>
) -> Pin<Box<dyn Future<Output = Result<Bytes, ProviderError>> + Send + 'async_trait>> where
T: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
Returns the deployed code at a given address
fn resolve_name<'life0, 'life1, 'async_trait>(
&'life0 self,
ens_name: &'life1 str
) -> Pin<Box<dyn Future<Output = Result<Address, ProviderError>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait, [src]
&'life0 self,
ens_name: &'life1 str
) -> Pin<Box<dyn Future<Output = Result<Address, ProviderError>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Returns the address that the ens_name resolves to (or None if not configured).
Panics
If the bytes returned from the ENS registrar/resolver cannot be interpreted as an address. This should theoretically never happen.
fn lookup_address<'life0, 'async_trait>(
&'life0 self,
address: Address
) -> Pin<Box<dyn Future<Output = Result<String, ProviderError>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait, [src]
&'life0 self,
address: Address
) -> Pin<Box<dyn Future<Output = Result<String, ProviderError>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Returns the ENS name the address resolves to (or None if not configured).
Panics
If the bytes returned from the ENS registrar/resolver cannot be interpreted as a string. This should theoretically never happen.
fn txpool_content<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<TxpoolContent, ProviderError>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait, [src]
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<TxpoolContent, ProviderError>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Returns the details of all transactions currently pending for inclusion in the next block(s), as well as the ones that are being scheduled for future execution only. Ref: Here
fn txpool_inspect<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<TxpoolInspect, ProviderError>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait, [src]
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<TxpoolInspect, ProviderError>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Returns a summary of all the transactions currently pending for inclusion in the next block(s), as well as the ones that are being scheduled for future execution only. Ref: Here
fn txpool_status<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<TxpoolStatus, ProviderError>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait, [src]
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<TxpoolStatus, ProviderError>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Returns the number of transactions currently pending for inclusion in the next block(s), as well as the ones that are being scheduled for future execution only. Ref: Here
fn trace_call<'life0, 'async_trait>(
&'life0 self,
req: TransactionRequest,
trace_type: Vec<TraceType>,
block: Option<BlockNumber>
) -> Pin<Box<dyn Future<Output = Result<BlockTrace, ProviderError>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait, [src]
&'life0 self,
req: TransactionRequest,
trace_type: Vec<TraceType>,
block: Option<BlockNumber>
) -> Pin<Box<dyn Future<Output = Result<BlockTrace, ProviderError>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Executes the given call and returns a number of possible traces for it
fn trace_raw_transaction<'life0, 'async_trait>(
&'life0 self,
data: Bytes,
trace_type: Vec<TraceType>
) -> Pin<Box<dyn Future<Output = Result<BlockTrace, ProviderError>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait, [src]
&'life0 self,
data: Bytes,
trace_type: Vec<TraceType>
) -> Pin<Box<dyn Future<Output = Result<BlockTrace, ProviderError>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Traces a call to eth_sendRawTransaction without making the call, returning the traces
fn trace_replay_transaction<'life0, 'async_trait>(
&'life0 self,
hash: H256,
trace_type: Vec<TraceType>
) -> Pin<Box<dyn Future<Output = Result<BlockTrace, ProviderError>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait, [src]
&'life0 self,
hash: H256,
trace_type: Vec<TraceType>
) -> Pin<Box<dyn Future<Output = Result<BlockTrace, ProviderError>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Replays a transaction, returning the traces
fn trace_replay_block_transactions<'life0, 'async_trait>(
&'life0 self,
block: BlockNumber,
trace_type: Vec<TraceType>
) -> Pin<Box<dyn Future<Output = Result<Vec<BlockTrace>, ProviderError>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait, [src]
&'life0 self,
block: BlockNumber,
trace_type: Vec<TraceType>
) -> Pin<Box<dyn Future<Output = Result<Vec<BlockTrace>, ProviderError>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Replays all transactions in a block returning the requested traces for each transaction
fn trace_block<'life0, 'async_trait>(
&'life0 self,
block: BlockNumber
) -> Pin<Box<dyn Future<Output = Result<Vec<Trace>, ProviderError>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait, [src]
&'life0 self,
block: BlockNumber
) -> Pin<Box<dyn Future<Output = Result<Vec<Trace>, ProviderError>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Returns traces created at given block
fn trace_filter<'life0, 'async_trait>(
&'life0 self,
filter: TraceFilter
) -> Pin<Box<dyn Future<Output = Result<Vec<Trace>, ProviderError>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait, [src]
&'life0 self,
filter: TraceFilter
) -> Pin<Box<dyn Future<Output = Result<Vec<Trace>, ProviderError>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Return traces matching the given filter
fn trace_get<'life0, 'async_trait, T: Into<U64> + Send + Sync>(
&'life0 self,
hash: H256,
index: Vec<T>
) -> Pin<Box<dyn Future<Output = Result<Trace, ProviderError>> + Send + 'async_trait>> where
T: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait, [src]
&'life0 self,
hash: H256,
index: Vec<T>
) -> Pin<Box<dyn Future<Output = Result<Trace, ProviderError>> + Send + 'async_trait>> where
T: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
Returns trace at the given position
fn trace_transaction<'life0, 'async_trait>(
&'life0 self,
hash: H256
) -> Pin<Box<dyn Future<Output = Result<Vec<Trace>, ProviderError>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait, [src]
&'life0 self,
hash: H256
) -> Pin<Box<dyn Future<Output = Result<Vec<Trace>, ProviderError>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Returns all traces of a given transaction
fn parity_block_receipts<'life0, 'async_trait, T: Into<BlockNumber> + Send + Sync>(
&'life0 self,
block: T
) -> Pin<Box<dyn Future<Output = Result<Vec<TransactionReceipt>, Self::Error>> + Send + 'async_trait>> where
T: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait, [src]
&'life0 self,
block: T
) -> Pin<Box<dyn Future<Output = Result<Vec<TransactionReceipt>, Self::Error>> + Send + 'async_trait>> where
T: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
Returns all receipts for that block. Must be done on a parity node.
fn subscribe<'life0, 'async_trait, T, R>(
&'life0 self,
params: T
) -> Pin<Box<dyn Future<Output = Result<SubscriptionStream<'_, P, R>, ProviderError>> + Send + 'async_trait>> where
T: Debug + Serialize + Send + Sync,
R: DeserializeOwned + Send + Sync,
P: PubsubClient,
T: 'async_trait,
R: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait, [src]
&'life0 self,
params: T
) -> Pin<Box<dyn Future<Output = Result<SubscriptionStream<'_, P, R>, ProviderError>> + Send + 'async_trait>> where
T: Debug + Serialize + Send + Sync,
R: DeserializeOwned + Send + Sync,
P: PubsubClient,
T: 'async_trait,
R: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
fn unsubscribe<'life0, 'async_trait, T>(
&'life0 self,
id: T
) -> Pin<Box<dyn Future<Output = Result<bool, ProviderError>> + Send + 'async_trait>> where
T: Into<U256> + Send + Sync,
P: PubsubClient,
T: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait, [src]
&'life0 self,
id: T
) -> Pin<Box<dyn Future<Output = Result<bool, ProviderError>> + Send + 'async_trait>> where
T: Into<U256> + Send + Sync,
P: PubsubClient,
T: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
fn subscribe_blocks<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<SubscriptionStream<'_, P, Block<TxHash>>, ProviderError>> + Send + 'async_trait>> where
P: PubsubClient,
'life0: 'async_trait,
Self: 'async_trait, [src]
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<SubscriptionStream<'_, P, Block<TxHash>>, ProviderError>> + Send + 'async_trait>> where
P: PubsubClient,
'life0: 'async_trait,
Self: 'async_trait,
fn subscribe_pending_txs<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<SubscriptionStream<'_, P, TxHash>, ProviderError>> + Send + 'async_trait>> where
P: PubsubClient,
'life0: 'async_trait,
Self: 'async_trait, [src]
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<SubscriptionStream<'_, P, TxHash>, ProviderError>> + Send + 'async_trait>> where
P: PubsubClient,
'life0: 'async_trait,
Self: 'async_trait,
fn subscribe_logs<'a, 'life0, 'async_trait>(
&'a self,
filter: &'life0 Filter
) -> Pin<Box<dyn Future<Output = Result<SubscriptionStream<'a, P, Log>, ProviderError>> + Send + 'async_trait>> where
P: PubsubClient,
'a: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait, [src]
&'a self,
filter: &'life0 Filter
) -> Pin<Box<dyn Future<Output = Result<SubscriptionStream<'a, P, Log>, ProviderError>> + Send + 'async_trait>> where
P: PubsubClient,
'a: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
impl TryFrom<&'_ str> for Provider<HttpProvider>[src]
type Error = ParseError
The type returned in the event of a conversion error.
fn try_from(src: &str) -> Result<Self, Self::Error>[src]
impl TryFrom<String> for Provider<HttpProvider>[src]
Auto Trait Implementations
impl<P> RefUnwindSafe for Provider<P> where
P: RefUnwindSafe,
P: RefUnwindSafe,
impl<P> Send for Provider<P> where
P: Send,
P: Send,
impl<P> Sync for Provider<P> where
P: Sync,
P: Sync,
impl<P> Unpin for Provider<P> where
P: Unpin,
P: Unpin,
impl<P> UnwindSafe for Provider<P> where
P: UnwindSafe,
P: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<A, T> AsBits<T> for A where
T: BitStore + BitMemory,
A: AsRef<[T]>,
T: BitStore + BitMemory,
A: AsRef<[T]>,
pub fn as_bits<O>(&self) -> &BitSlice<O, T> where
O: BitOrder,
O: BitOrder,
impl<T, U> AsByteSlice<T> for U where
T: ToByteSlice,
U: AsRef<[T]> + ?Sized,
T: ToByteSlice,
U: AsRef<[T]> + ?Sized,
pub fn as_byte_slice(&self) -> &[u8]
impl<U> AsSliceOf for U where
U: AsRef<[u8]> + ?Sized,
U: AsRef<[u8]> + ?Sized,
pub fn as_slice_of<T>(&self) -> Result<&[T], Error> where
T: FromByteSlice,
T: FromByteSlice,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<T> Conv for T
impl<T> FmtForward for T
pub fn fmt_binary(self) -> FmtBinary<Self> where
Self: Binary,
Self: Binary,
pub fn fmt_display(self) -> FmtDisplay<Self> where
Self: Display,
Self: Display,
pub fn fmt_lower_exp(self) -> FmtLowerExp<Self> where
Self: LowerExp,
Self: LowerExp,
pub fn fmt_lower_hex(self) -> FmtLowerHex<Self> where
Self: LowerHex,
Self: LowerHex,
pub fn fmt_octal(self) -> FmtOctal<Self> where
Self: Octal,
Self: Octal,
pub fn fmt_pointer(self) -> FmtPointer<Self> where
Self: Pointer,
Self: Pointer,
pub fn fmt_upper_exp(self) -> FmtUpperExp<Self> where
Self: UpperExp,
Self: UpperExp,
pub fn fmt_upper_hex(self) -> FmtUpperHex<Self> where
Self: UpperHex,
Self: UpperHex,
impl<T> From<T> for T[src]
impl<T> Instrument for T[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>[src]
pub fn in_current_span(self) -> Instrumented<Self>[src]
impl<T> Instrument for T[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>[src]
pub fn in_current_span(self) -> Instrumented<Self>[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> Pipe for T
impl<T> PipeAsRef for T
pub fn pipe_as_ref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R where
Self: AsRef<T>,
T: 'a,
R: 'a,
Self: AsRef<T>,
T: 'a,
R: 'a,
pub fn pipe_as_mut<'a, T, R>(
&'a mut self,
func: impl FnOnce(&'a mut T) -> R
) -> R where
Self: AsMut<T>,
T: 'a,
R: 'a,
&'a mut self,
func: impl FnOnce(&'a mut T) -> R
) -> R where
Self: AsMut<T>,
T: 'a,
R: 'a,
impl<T> PipeBorrow for T
pub fn pipe_borrow<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R where
Self: Borrow<T>,
T: 'a,
R: 'a,
Self: Borrow<T>,
T: 'a,
R: 'a,
pub fn pipe_borrow_mut<'a, T, R>(
&'a mut self,
func: impl FnOnce(&'a mut T) -> R
) -> R where
Self: BorrowMut<T>,
T: 'a,
R: 'a,
&'a mut self,
func: impl FnOnce(&'a mut T) -> R
) -> R where
Self: BorrowMut<T>,
T: 'a,
R: 'a,
impl<T> PipeDeref for T
pub fn pipe_deref<'a, R>(
&'a self,
func: impl FnOnce(&'a Self::Target) -> R
) -> R where
Self: Deref,
R: 'a,
&'a self,
func: impl FnOnce(&'a Self::Target) -> R
) -> R where
Self: Deref,
R: 'a,
pub fn pipe_deref_mut<'a, R>(
&'a mut self,
func: impl FnOnce(&'a mut Self::Target) -> R
) -> R where
Self: DerefMut,
R: 'a,
&'a mut self,
func: impl FnOnce(&'a mut Self::Target) -> R
) -> R where
Self: DerefMut,
R: 'a,
impl<T> PipeRef for T
pub fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> R where
R: 'a,
R: 'a,
pub fn pipe_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> R where
R: 'a,
R: 'a,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> Tap for T
pub fn tap<F, R>(self, func: F) -> Self where
F: FnOnce(&Self) -> R,
F: FnOnce(&Self) -> R,
pub fn tap_dbg<F, R>(self, func: F) -> Self where
F: FnOnce(&Self) -> R,
F: FnOnce(&Self) -> R,
pub fn tap_mut<F, R>(self, func: F) -> Self where
F: FnOnce(&mut Self) -> R,
F: FnOnce(&mut Self) -> R,
pub fn tap_mut_dbg<F, R>(self, func: F) -> Self where
F: FnOnce(&mut Self) -> R,
F: FnOnce(&mut Self) -> R,
impl<T, U> TapAsRef<U> for T where
U: ?Sized,
U: ?Sized,
pub fn tap_ref<F, R>(self, func: F) -> Self where
Self: AsRef<T>,
F: FnOnce(&T) -> R,
Self: AsRef<T>,
F: FnOnce(&T) -> R,
pub fn tap_ref_dbg<F, R>(self, func: F) -> Self where
Self: AsRef<T>,
F: FnOnce(&T) -> R,
Self: AsRef<T>,
F: FnOnce(&T) -> R,
pub fn tap_ref_mut<F, R>(self, func: F) -> Self where
Self: AsMut<T>,
F: FnOnce(&mut T) -> R,
Self: AsMut<T>,
F: FnOnce(&mut T) -> R,
pub fn tap_ref_mut_dbg<F, R>(self, func: F) -> Self where
Self: AsMut<T>,
F: FnOnce(&mut T) -> R,
Self: AsMut<T>,
F: FnOnce(&mut T) -> R,
impl<T, U> TapBorrow<U> for T where
U: ?Sized,
U: ?Sized,
pub fn tap_borrow<F, R>(self, func: F) -> Self where
Self: Borrow<T>,
F: FnOnce(&T) -> R,
Self: Borrow<T>,
F: FnOnce(&T) -> R,
pub fn tap_borrow_dbg<F, R>(self, func: F) -> Self where
Self: Borrow<T>,
F: FnOnce(&T) -> R,
Self: Borrow<T>,
F: FnOnce(&T) -> R,
pub fn tap_borrow_mut<F, R>(self, func: F) -> Self where
Self: BorrowMut<T>,
F: FnOnce(&mut T) -> R,
Self: BorrowMut<T>,
F: FnOnce(&mut T) -> R,
pub fn tap_borrow_mut_dbg<F, R>(self, func: F) -> Self where
Self: BorrowMut<T>,
F: FnOnce(&mut T) -> R,
Self: BorrowMut<T>,
F: FnOnce(&mut T) -> R,
impl<T> TapDeref for T
pub fn tap_deref<F, R>(self, func: F) -> Self where
Self: Deref,
F: FnOnce(&Self::Target) -> R,
Self: Deref,
F: FnOnce(&Self::Target) -> R,
pub fn tap_deref_dbg<F, R>(self, func: F) -> Self where
Self: Deref,
F: FnOnce(&Self::Target) -> R,
Self: Deref,
F: FnOnce(&Self::Target) -> R,
pub fn tap_deref_mut<F, R>(self, func: F) -> Self where
Self: DerefMut,
F: FnOnce(&mut Self::Target) -> R,
Self: DerefMut,
F: FnOnce(&mut Self::Target) -> R,
pub fn tap_deref_mut_dbg<F, R>(self, func: F) -> Self where
Self: DerefMut,
F: FnOnce(&mut Self::Target) -> R,
Self: DerefMut,
F: FnOnce(&mut Self::Target) -> R,
impl<T> ToHex for T where
T: AsRef<[u8]>, [src]
T: AsRef<[u8]>,
pub fn encode_hex<U>(&self) -> U where
U: FromIterator<char>, [src]
U: FromIterator<char>,
pub fn encode_hex_upper<U>(&self) -> U where
U: FromIterator<char>, [src]
U: FromIterator<char>,
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
pub fn clone_into(&self, target: &mut T)[src]
impl<T> TryConv for T
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,