Type Alias EmptyDB

Source
pub type EmptyDB = EmptyDBTyped<Infallible>;
Expand description

An empty database that always returns default values when queried.

Aliased Type§

struct EmptyDB { /* private fields */ }

Implementations

Source§

impl<E> EmptyDBTyped<E>

Source

pub fn new() -> Self

Trait Implementations

Source§

impl<E> Clone for EmptyDBTyped<E>

Source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<E> Database for EmptyDBTyped<E>

Source§

type Error = E

The database error type.
Source§

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

Get basic account information.
Source§

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

Get account code by its hash.
Source§

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

Get storage value of address at index.
Source§

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

Get block hash by block number.
Source§

impl<E> DatabaseRef for EmptyDBTyped<E>

Source§

type Error = E

The database error type.
Source§

fn basic_ref( &self, _address: Address, ) -> Result<Option<AccountInfo>, Self::Error>

Get basic account information.
Source§

fn code_by_hash_ref(&self, _code_hash: B256) -> Result<Bytecode, Self::Error>

Get account code by its hash.
Source§

fn storage_ref( &self, _address: Address, _index: U256, ) -> Result<U256, Self::Error>

Get storage value of address at index.
Source§

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

Get block hash by block number.
Source§

impl<E> Debug for EmptyDBTyped<E>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<E> Default for EmptyDBTyped<E>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<E> PartialEq for EmptyDBTyped<E>

Source§

fn eq(&self, _: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<E> Copy for EmptyDBTyped<E>

Source§

impl<E> Eq for EmptyDBTyped<E>