DatabaseCommit

Trait DatabaseCommit 

Source
pub trait DatabaseCommit {
    // Required method
    fn commit(&mut self, changes: HashMap<Address, Account>);

    // Provided method
    fn commit_iter(
        &mut self,
        changes: impl IntoIterator<Item = (Address, Account)>,
    ) { ... }
}
Expand description

EVM database commit interface.

Required Methods§

Source

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

Commit changes to the database.

Provided Methods§

Source

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

Commit changes to the database with an iterator.

Implementors of DatabaseCommit should override this method when possible for efficiency.

Callers should prefer using DatabaseCommit::commit when they already have a [HashMap].

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.

Implementations on Foreign Types§

Source§

impl<'a, T: 'a + DatabaseCommit + ?Sized> DatabaseCommit for &'a mut T

Source§

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

Source§

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

Source§

impl<L, R> DatabaseCommit for Either<L, R>

Source§

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

Source§

impl<T: DatabaseCommit + ?Sized> DatabaseCommit for Box<T>

Source§

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

Source§

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

Implementors§