pub trait ChangeSetReader {
// Required methods
fn account_block_changeset(
&self,
block_number: u64,
) -> Result<Vec<AccountBeforeTx>, ProviderError>;
fn get_account_before_block(
&self,
block_number: u64,
address: Address,
) -> Result<Option<AccountBeforeTx>, ProviderError>;
fn account_changesets_range(
&self,
range: impl RangeBounds<u64>,
) -> Result<Vec<(u64, AccountBeforeTx)>, ProviderError>;
fn account_changeset_count(&self) -> Result<usize, ProviderError>;
}Available on crate feature
storage-api only.Expand description
AccountChange reader
Required Methods§
Sourcefn account_block_changeset(
&self,
block_number: u64,
) -> Result<Vec<AccountBeforeTx>, ProviderError>
fn account_block_changeset( &self, block_number: u64, ) -> Result<Vec<AccountBeforeTx>, ProviderError>
Iterate over account changesets and return the account state from before this block.
Sourcefn get_account_before_block(
&self,
block_number: u64,
address: Address,
) -> Result<Option<AccountBeforeTx>, ProviderError>
fn get_account_before_block( &self, block_number: u64, address: Address, ) -> Result<Option<AccountBeforeTx>, ProviderError>
Search the block’s changesets for the given address, and return the result.
Returns None if the account was not changed in this block.
Sourcefn account_changesets_range(
&self,
range: impl RangeBounds<u64>,
) -> Result<Vec<(u64, AccountBeforeTx)>, ProviderError>
fn account_changesets_range( &self, range: impl RangeBounds<u64>, ) -> Result<Vec<(u64, AccountBeforeTx)>, ProviderError>
Get all account changesets in a range of blocks.
Accepts any range type that implements RangeBounds<BlockNumber>, including:
Range<BlockNumber>(e.g.,0..100)RangeInclusive<BlockNumber>(e.g.,0..=99)RangeFrom<BlockNumber>(e.g.,0..) - iterates until exhausted
If there is no start bound, 0 is used as the start block.
Returns a vector of (block_number, changeset) pairs.
Sourcefn account_changeset_count(&self) -> Result<usize, ProviderError>
fn account_changeset_count(&self) -> Result<usize, ProviderError>
Get the total count of all account changes.
Returns the total number of account changes across all blocks.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.