Skip to main content

StateView

Trait StateView 

Source
pub trait StateView {
    // Required method
    fn storage(&self, address: Address, slot: U256) -> Option<U256>;
}
Expand description

Read-only view of current cached state handed to a decoder.

Decoders that compute post-state from pre-state read through this; stateless decoders (such as the built-in ERC-20 Transfer decoder) ignore it. The view never touches RPC — a slot absent from the cache reads None.

Required Methods§

Source

fn storage(&self, address: Address, slot: U256) -> Option<U256>

Current cached value of (address, slot) (overlay ▸ backend ▸ None), matching what the EVM would SLOAD (account_state-aware). None means the slot is cold — neither cache layer has seen it.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl StateView for EvmCache

Read-only state view for the event pipeline (Pillar B.2): a decoder reads the current cached value of a slot through cached_storage_value, which never touches RPC and is account_state-aware (a cold slot reads None).