pub trait StateSource: Send + Sync {
type Error: Error + Send + 'static;
// Required method
fn account_details(
&self,
address: &Address,
) -> impl Future<Output = Result<AcctInfo, Self::Error>> + Send;
// Provided methods
fn nonce(
&self,
address: &Address,
) -> impl Future<Output = Result<u64, Self::Error>> + Send { ... }
fn balance(
&self,
address: &Address,
) -> impl Future<Output = Result<U256, Self::Error>> + Send { ... }
fn map<T: Send, F: FnOnce(&AcctInfo) -> T + Send>(
&self,
address: &Address,
f: F,
) -> impl Future<Output = Result<T, Self::Error>> + Send { ... }
}Expand description
A source for nonce and balance information. Exists to simplify type bounds in various places.
Required Associated Types§
Required Methods§
Provided Methods§
Sourcefn nonce(
&self,
address: &Address,
) -> impl Future<Output = Result<u64, Self::Error>> + Send
fn nonce( &self, address: &Address, ) -> impl Future<Output = Result<u64, Self::Error>> + Send
Get the nonce for an address. Returns the NEXT EXPECTED nonce, i.e. 0 for an address that
has never sent a transaction, 1 for an address that has sent exactly one transaction, etc.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".