Skip to main content

EvmOverlay

Struct EvmOverlay 

Source
pub struct EvmOverlay { /* private fields */ }
Expand description

Per-simulation mutable overlay on an immutable snapshot.

Lookup order: dirty layer → snapshot → ext_db (optional RPC fallback).

This type is Send (unlike EvmCache) because it uses no Rc/RefCell. Each simulation task gets its own EvmOverlay with a cheap Arc::clone of the shared EvmSnapshot.

§Reuse across simulations (Pillar A.2)

A worker doing many sims against the same snapshot can call Self::new once and Self::reset between sims instead of allocating a fresh overlay each time. The reusable shared-memory buffer is also recycled across calls — see Self::call_raw — without making the overlay !Send.

Implementations§

Source§

impl EvmOverlay

Source

pub fn new(snapshot: Arc<EvmSnapshot>, ext_db: Option<SharedBackend>) -> Self

Create a new overlay on the given snapshot.

The reusable shared-memory buffer is pre-allocated to the snapshot’s configured shared-memory capacity (see SharedMemoryCapacity).

Source

pub fn reset(&mut self)

Clear the per-simulation dirty layer so this overlay can be reused for the next simulation against the same snapshot, without reallocating (Pillar A.2).

A worker doing K sims calls Self::new once and reset() between sims instead of allocating a fresh overlay (plus dirty maps plus an Arc clone) each time. After reset() the overlay reads the pristine snapshot again — it is exactly equivalent to a freshly-built overlay on the same snapshot. The snapshot Arc, the optional ext_db, and the reusable shared-memory buffer (kept at capacity) are retained.

Source

pub fn blockhash_zero_fallback(&self) -> bool

true if any BLOCKHASH read on this overlay fell through to the ZERO fallback (no snapshot-provided hash for that number and no ext_db) since construction or the last reset.

The freshness validator uses this to fail closed: a sim that read a hash its ext-db-less overlays cannot resolve is reported Unverified rather than silently confirmed against a ZERO stand-in.

Only reads revm actually routes to the database can set this: requests outside the EVM’s valid lookback window ([current − 256, current)) return spec-mandated ZERO without a database call — that value is correct on-chain too, so such reads are deliberately not flagged.

Source

pub fn chain_id(&self) -> u64

Chain ID of the block context captured by the underlying snapshot.

This is the value installed into cfg.chain_id by Self::build_evm.

Source

pub fn block_number(&self) -> Option<u64>

Block number of the snapshot’s block context, or None if it was not captured.

When present this is the block.number simulations run against; when None, Self::build_evm leaves revm’s default block number in place.

Source

pub fn basefee(&self) -> Option<u64>

Base fee of the snapshot’s block context, or None if it was not captured.

Note that base-fee checks are disabled in the simulation EVM, so this is informational rather than enforced against the transaction.

Source

pub fn timestamp(&self) -> Option<u64>

Timestamp of the snapshot’s block context, or None if it was not captured.

When None, Self::build_evm substitutes the current wall-clock time for block.timestamp.

Source

pub fn build_evm( &mut self, ) -> MainnetEvm<Context<BlockEnv, TxEnv, CfgEnv, &'_ mut EvmOverlay, Journal<&'_ mut EvmOverlay>, ()>>

Build a revm EVM instance backed by this overlay.

This allocates a fresh 64 KB shared-memory buffer each call: it hands the EVM out to the caller and cannot reclaim the buffer afterwards, so it cannot recycle the overlay’s reusable buffer. The internal call methods (Self::call_raw, etc.) recycle the buffer instead (Pillar A.2).

Note: The returned EVM is !Send (due to LocalContext’s Rc<RefCell>), but this is fine because it’s created and used within a single task.

Source

pub fn call_raw( &mut self, from: Address, to: Address, calldata: Bytes, ) -> Result<ExecutionResult>

Execute a non-committing call and return the raw ExecutionResult.

The EVM state is reverted to a checkpoint after execution on both success and failure, so the call never mutates this overlay’s dirty layer. Each overlay simulation is therefore isolated: repeated calls all observe the same base state.

A revert or halt is not an error here — it is reported through the returned ExecutionResult variant. Only failure to build or transact the call yields Err.

§Errors

Returns an error if the TxEnv cannot be built from the given inputs, or if revm fails to transact the call (for example a database error while loading state from the RPC fallback).

§Examples
let mut overlay = EvmOverlay::new(snapshot, None);
let result = overlay.call_raw(Address::ZERO, Address::ZERO, Bytes::new())?;
// State is reverted; a second call sees the same base state.
let _again = overlay.call_raw(Address::ZERO, Address::ZERO, Bytes::new())?;
Source

pub fn simulate_with_transfer_tracking( &mut self, from: Address, to: Address, calldata: Bytes, owner: Address, tokens: Option<impl IntoIterator<Item = Address>>, commit: bool, ) -> SimulationResult<CallSimulationResult>

Simulate a call with transfer tracking via the TransferInspector.

This is the overlay-compatible equivalent of super::EvmCache::simulate_with_transfer_tracking. It captures ERC20 Transfer events during execution to compute balance deltas for owner (restricted to tokens when provided) without relying on pre/post balance queries.

On a reverting or halting call the EVM state is reverted to a checkpoint before returning, so a failed simulation never mutates this overlay. On success the call either commits the journaled changes into the overlay’s dirty layer (commit == true) or reverts them (commit == false); a non-committing run leaves each overlay simulation isolated from the next.

§Errors

Returns an error if the TxEnv cannot be built, if revm fails to transact the call, if the call reverts (mapped from the revert payload), or if the call halts. In every error case the EVM state is reverted first, regardless of commit.

§Examples
let mut overlay = EvmOverlay::new(snapshot, None);
let sim = overlay.simulate_with_transfer_tracking(
    owner,
    token,
    Bytes::new(),
    owner,
    Some([token]),
    false, // non-committing: state is reverted afterwards
)?;
let _delta = sim.token_deltas.get(&token);
Source

pub fn call_raw_with_inspector<I>( &mut self, from: Address, to: Address, calldata: Bytes, tx: &TxConfig, inspector: I, commit: bool, ) -> SimulationResult<(ExecutionResult, I)>
where I: for<'a> Inspector<Context<BlockEnv, TxEnv, CfgEnv, &'a mut EvmOverlay, Journal<&'a mut EvmOverlay>, ()>>,

Run a single call with a caller-supplied Inspector, returning the raw ExecutionResult and handing the inspector back for the caller to read.

This is the inspector-generic public seam: where Self::simulate_with_transfer_tracking hard-wires the TransferInspector, this accepts any revm::Inspector — a CallTracer, an InspectorStack composing several, or a caller-defined one. It honors a full TxConfig (value/gas/nonce/access list) exactly like Self::call_raw_with_access_list_with and recycles the reusable shared-memory buffer like the other call methods.

Unlike simulate_with_transfer_tracking, a revert or halt is not an error: the raw ExecutionResult variant (Success / Revert / Halt) is returned as Ok so the inspector’s captured frames (e.g. a reverted call tree) remain observable. Only a tx-env build failure or a transact/database error yields Err.

On a successful transact the journaled changes are either committed into the overlay’s dirty layer (commit == true) or reverted (commit == false), matching Self::simulate_with_transfer_tracking. On a revert/halt the checkpoint is always reverted regardless of commit, so a failed call never mutates this overlay. On a transact error the checkpoint is reverted too.

§Errors

Returns an error if the TxEnv cannot be built from from/to/tx, or if revm fails to transact the call (e.g. a database error while loading state).

§Examples
let mut overlay = EvmOverlay::new(snapshot, None);
let (result, tracer) = overlay.call_raw_with_inspector(
    Address::ZERO,
    to,
    Bytes::new(),
    &TxConfig::default(),
    CallTracer::new(),
    false,
)?;
let _ = result;
let _trace = tracer.into_trace();
Source

pub fn simulate_bundle( &mut self, txs: &[BundleTx], opts: &BundleOptions, ) -> SimulationResult<BundleResult>

Apply txs in order against this overlay over cumulative block state, with a revert policy and coinbase/miner-payment accounting (Phase 6 Track A+B).

Each transaction observes the committed writes of the ones before it: the bundle runs on a single overlay/EVM with one outer checkpoint plus a per-transaction inner checkpoint, so it does not rebuild a fresh overlay per transaction. See the bundle module for the public vocabulary (BundleTx, BundleOptions, RevertPolicy, TxOutcome, BundleResult).

§Revert policy
  • RevertPolicy::Atomic: the first transaction that reverts/halts rolls the whole bundle back to the outer checkpoint, sets succeeded = false, and stops (per_tx ends at the failing transaction). coinbase_payment is 0 and the overlay is unchanged.
  • RevertPolicy::AllowReverts: a revert at a whitelisted index rolls back only that transaction (inner checkpoint) and execution continues; a revert at a non-whitelisted index behaves like Atomic.
§Coinbase accounting

coinbase_payment is the block beneficiary’s balance delta across the kept transactions. Under EIP-1559 revm credits the beneficiary only the priority fee ((effective_gas_price − basefee) × gas_used) and burns the base fee in-EVM, so the delta is the honest miner payment (plus any direct coinbase tips). Saturating.

§Commit semantics

opts.commit == true folds the bundle’s cumulative state into this overlay’s dirty layer (observable by subsequent overlay calls); false reverts the outer checkpoint so the overlay is unchanged. A failed atomic bundle never leaves partial state regardless of commit.

§Errors

Returns SimError if a transaction environment cannot be built or revm fails to transact (e.g. a database error). A transaction reverting is not an error — it is reported through the per-transaction TxOutcome and the revert policy.

Source

pub fn call_raw_with_access_list( &mut self, from: Address, to: Address, calldata: Bytes, ) -> Result<(ExecutionResult, StorageAccessList)>

Execute a non-committing call and return the result plus the touched StorageAccessList.

The access list is collected from every account marked touched in the journaled state after execution, recording both the touched accounts and the storage slots accessed under each.

The EVM state is reverted to a checkpoint after a successful transact on both success and revert/halt outcomes, so the call never mutates this overlay’s dirty layer and each overlay simulation stays isolated. As with Self::call_raw, a revert or halt is reported through the returned ExecutionResult rather than as an error.

§Errors

Returns an error if the TxEnv cannot be built, or if revm fails to transact the call (for example a database error while loading state).

§Examples
let mut overlay = EvmOverlay::new(snapshot, None);
let (result, access_list) =
    overlay.call_raw_with_access_list(Address::ZERO, Address::ZERO, Bytes::new())?;
Source

pub fn call_raw_with_access_list_with( &mut self, from: Address, to: Address, calldata: Bytes, tx: &TxConfig, ) -> Result<(ExecutionResult, StorageAccessList)>

Like call_raw_with_access_list but honors a full TxConfig: native value, gas_limit, gas_price, nonce, and a pre-warming EIP-2930 access_list.

This is what the freshness optimistic loop uses so a SimRequest’s tx environment — e.g. a payable call carrying value, or a gas-bounded call — is reproduced faithfully instead of silently running as a zero-value, default-gas call. Like the shorthand it is non-committing (the checkpoint is reverted) and returns the captured storage access list.

Source

pub fn override_slot(&mut self, address: Address, slot: U256, value: U256)

Write a storage value into this overlay’s dirty layer.

The dirty layer takes precedence over the snapshot on subsequent reads (see the lookup order on EvmOverlay), so this injects a value into a snapshot-backed overlay without mutating the shared snapshot.

§Freshness validation

This is the freshness validator’s correction step. When a slot the snapshot captured is found to be stale, the validator writes the freshly-fetched value here and then re-runs the simulation (e.g. via Self::call_raw): the re-run reads the corrected slot out of the dirty layer instead of the stale snapshot value, so the corrected result becomes observable. Because the override lives only in this overlay, other overlays sharing the same Arc<EvmSnapshot> are unaffected.

§Examples
let mut overlay = EvmOverlay::new(snapshot, None);
// Inject the fresh value, then re-run to observe the corrected result.
overlay.override_slot(token, slot, U256::from(42u64));
let corrected = overlay.call_raw(Address::ZERO, token, Bytes::new())?;
Source

pub fn call_sol<C: SolCall>( &mut self, to: Address, call: C, ) -> Result<C::Return>

Execute a non-committing typed Solidity call from Address::ZERO, decoding the return — the overlay counterpart to EvmCache::call_sol.

let bal = overlay.call_sol(token, IErc20::balanceOfCall { account: alice })?;
Source

pub fn call_sol_from<C: SolCall>( &mut self, from: Address, to: Address, call: C, ) -> Result<C::Return>

Execute a non-committing typed Solidity call from an explicit sender, decoding the return.

Source

pub fn mock_balance( &mut self, token: Address, holder: Address, amount: U256, ) -> SimulationResult<bool>

Mock holder’s ERC-20 balance of token to amountoverlay-local.

Discovers the balance mapping slot and layout (Solidity / Vyper / Solady) from a single balanceOf(holder) simulation, writes amount to that slot in this overlay’s dirty layer via override_slot, and verifies. The cache and snapshot are never mutated; the mock is dropped with the overlay.

Returns Ok(true) if set and verified, Ok(false) if no balance slot was discoverable or the write did not drive the return (e.g. a rebasing token, or holder == Address::ZERO, which is refused). A failed attempt leaves no stray write.

Source

pub fn mock_allowance( &mut self, token: Address, owner: Address, spender: Address, amount: U256, ) -> SimulationResult<bool>

Mock owner’s ERC-20 allowance to spender on token — overlay-local.

Discovers the (nested) allowance mapping entry keyed by both addresses, writes amount (pass U256::MAX for “unlimited”), and verifies. Refuses owner == Address::ZERO. Same isolation and failure semantics as mock_balance.

Source

pub fn mock_view( &mut self, to: Address, calldata: Bytes, desired: U256, ) -> SimulationResult<bool>

Mock the return value of a single-word view call by finding the storage slot that drives it and overriding that slot — overlay-local.

Runs to.calldata, identifies the SLOAD whose loaded value equals the call’s returned word (see HashStorageProbe::slots_returning), writes desired there, and verifies the call now returns desired. Works for balances, allowances, totalSupply, and any getter that returns a single stored word. Returns Ok(false) (leaving no stray write) when the return is computed from more than one slot, so it can’t be set by a single override.

Source

pub fn mock_call<C: SolCall>( &mut self, to: Address, call: C, desired: U256, ) -> SimulationResult<bool>

Typed mock_view: mock the desired return of a SolCall getter that returns a single word.

overlay.mock_call(token, IErc20::totalSupplyCall {}, U256::from(1_000u64))?;

Trait Implementations§

Source§

impl Database for EvmOverlay

Source§

type Error = DatabaseError

The database error type.
Source§

fn basic( &mut self, address: Address, ) -> Result<Option<AccountInfo>, Self::Error>

Gets basic account information.
Source§

fn code_by_hash(&mut self, code_hash: B256) -> Result<Bytecode, Self::Error>

Gets account code by its hash.
Source§

fn storage( &mut self, address: Address, index: U256, ) -> Result<U256, Self::Error>

Gets storage value of address at index.
Source§

fn block_hash(&mut self, number: u64) -> Result<B256, Self::Error>

Gets block hash by block number.
Source§

fn storage_by_account_id( &mut self, address: Address, account_id: usize, storage_key: Uint<256, 4>, ) -> Result<Uint<256, 4>, Self::Error>

Gets storage value of account by its id. By default call Database::storage method. Read more
Source§

impl DatabaseCommit for EvmOverlay

Source§

fn commit(&mut self, changes: HashMap<Address, Account>)

Commit changes to the database.
Source§

fn commit_iter(&mut self, changes: &mut dyn Iterator<Item = (Address, Account)>)

Commit changes to the database with an iterator. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> Conv for T

Source§

fn conv<T>(self) -> T
where Self: Into<T>,

Converts self into T using Into<T>. Read more
Source§

impl<T> DatabaseCommitExt for T

Source§

fn increment_balances( &mut self, balances: impl IntoIterator<Item = (Address, u128)>, ) -> Result<(), Self::Error>

Iterates over received balances and increment all account balances. Read more
Source§

fn drain_balances( &mut self, addresses: impl IntoIterator<Item = Address>, ) -> Result<Vec<u128>, Self::Error>

Drains balances from given account and return those values. Read more
Source§

impl<T> FmtForward for T

Source§

fn fmt_binary(self) -> FmtBinary<Self>
where Self: Binary,

Causes self to use its Binary implementation when Debug-formatted.
Source§

fn fmt_display(self) -> FmtDisplay<Self>
where Self: Display,

Causes self to use its Display implementation when Debug-formatted.
Source§

fn fmt_lower_exp(self) -> FmtLowerExp<Self>
where Self: LowerExp,

Causes self to use its LowerExp implementation when Debug-formatted.
Source§

fn fmt_lower_hex(self) -> FmtLowerHex<Self>
where Self: LowerHex,

Causes self to use its LowerHex implementation when Debug-formatted.
Source§

fn fmt_octal(self) -> FmtOctal<Self>
where Self: Octal,

Causes self to use its Octal implementation when Debug-formatted.
Source§

fn fmt_pointer(self) -> FmtPointer<Self>
where Self: Pointer,

Causes self to use its Pointer implementation when Debug-formatted.
Source§

fn fmt_upper_exp(self) -> FmtUpperExp<Self>
where Self: UpperExp,

Causes self to use its UpperExp implementation when Debug-formatted.
Source§

fn fmt_upper_hex(self) -> FmtUpperHex<Self>
where Self: UpperHex,

Causes self to use its UpperHex implementation when Debug-formatted.
Source§

fn fmt_list(self) -> FmtList<Self>
where &'a Self: for<'a> IntoIterator,

Formats each item in a sequence. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pipe for T
where T: ?Sized,

Source§

fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> R
where Self: Sized,

Pipes by value. This is generally the method you want to use. Read more
Source§

fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> R
where R: 'a,

Borrows self and passes that borrow into the pipe function. Read more
Source§

fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> R
where R: 'a,

Mutably borrows self and passes that borrow into the pipe function. Read more
Source§

fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
where Self: Borrow<B>, B: 'a + ?Sized, R: 'a,

Borrows self, then passes self.borrow() into the pipe function. Read more
Source§

fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
where Self: BorrowMut<B>, B: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.borrow_mut() into the pipe function. Read more
Source§

fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
where Self: AsRef<U>, U: 'a + ?Sized, R: 'a,

Borrows self, then passes self.as_ref() into the pipe function.
Source§

fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
where Self: AsMut<U>, U: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.as_mut() into the pipe function.
Source§

fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
where Self: Deref<Target = T>, T: 'a + ?Sized, R: 'a,

Borrows self, then passes self.deref() into the pipe function.
Source§

fn pipe_deref_mut<'a, T, R>( &'a mut self, func: impl FnOnce(&'a mut T) -> R, ) -> R
where Self: DerefMut<Target = T> + Deref, T: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.deref_mut() into the pipe function.
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> Tap for T

Source§

fn tap(self, func: impl FnOnce(&Self)) -> Self

Immutable access to a value. Read more
Source§

fn tap_mut(self, func: impl FnOnce(&mut Self)) -> Self

Mutable access to a value. Read more
Source§

fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
where Self: Borrow<B>, B: ?Sized,

Immutable access to the Borrow<B> of a value. Read more
Source§

fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
where Self: BorrowMut<B>, B: ?Sized,

Mutable access to the BorrowMut<B> of a value. Read more
Source§

fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
where Self: AsRef<R>, R: ?Sized,

Immutable access to the AsRef<R> view of a value. Read more
Source§

fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
where Self: AsMut<R>, R: ?Sized,

Mutable access to the AsMut<R> view of a value. Read more
Source§

fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
where Self: Deref<Target = T>, T: ?Sized,

Immutable access to the Deref::Target of a value. Read more
Source§

fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
where Self: DerefMut<Target = T> + Deref, T: ?Sized,

Mutable access to the Deref::Target of a value. Read more
Source§

fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self

Calls .tap() only in debug builds, and is erased in release builds.
Source§

fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self

Calls .tap_mut() only in debug builds, and is erased in release builds.
Source§

fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
where Self: Borrow<B>, B: ?Sized,

Calls .tap_borrow() only in debug builds, and is erased in release builds.
Source§

fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
where Self: BorrowMut<B>, B: ?Sized,

Calls .tap_borrow_mut() only in debug builds, and is erased in release builds.
Source§

fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
where Self: AsRef<R>, R: ?Sized,

Calls .tap_ref() only in debug builds, and is erased in release builds.
Source§

fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
where Self: AsMut<R>, R: ?Sized,

Calls .tap_ref_mut() only in debug builds, and is erased in release builds.
Source§

fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
where Self: Deref<Target = T>, T: ?Sized,

Calls .tap_deref() only in debug builds, and is erased in release builds.
Source§

fn tap_deref_mut_dbg<T>(self, func: impl FnOnce(&mut T)) -> Self
where Self: DerefMut<Target = T> + Deref, T: ?Sized,

Calls .tap_deref_mut() only in debug builds, and is erased in release builds.
Source§

impl<T> TryConv for T

Source§

fn try_conv<T>(self) -> Result<T, Self::Error>
where Self: TryInto<T>,

Attempts to convert self into T using TryInto<T>. Read more
Source§

impl<Db> TryDatabaseCommit for Db
where Db: DatabaseCommit,

Source§

type Error = Infallible

Error type for when TryDatabaseCommit::try_commit fails.
Source§

fn try_commit( &mut self, changes: HashMap<Address, Account, DefaultHashBuilder>, ) -> Result<(), <Db as TryDatabaseCommit>::Error>

Attempt to commit changes to the database.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more