pub trait MaybeFullDatabase: DatabaseRef<Error = DatabaseError> {
// Required methods
fn as_dyn(&self) -> &dyn DatabaseRef<Error = DatabaseError>;
fn clear_into_state_snapshot(&mut self) -> StateSnapshot;
fn read_as_state_snapshot(&self) -> StateSnapshot;
fn clear(&mut self);
fn init_from_state_snapshot(&mut self, state_snapshot: StateSnapshot);
// Provided method
fn maybe_as_full_db(&self) -> Option<&HashMap<Address, DbAccount>> { ... }
}
Expand description
Helper trait get access to the full state data of the database
Required Methods§
Sourcefn as_dyn(&self) -> &dyn DatabaseRef<Error = DatabaseError>
fn as_dyn(&self) -> &dyn DatabaseRef<Error = DatabaseError>
Returns a reference to the database as a dyn DatabaseRef
.
Sourcefn clear_into_state_snapshot(&mut self) -> StateSnapshot
fn clear_into_state_snapshot(&mut self) -> StateSnapshot
Clear the state and move it into a new StateSnapshot
.
Sourcefn read_as_state_snapshot(&self) -> StateSnapshot
fn read_as_state_snapshot(&self) -> StateSnapshot
Read the state snapshot.
This clones all the states and returns a new StateSnapshot
.
Sourcefn init_from_state_snapshot(&mut self, state_snapshot: StateSnapshot)
fn init_from_state_snapshot(&mut self, state_snapshot: StateSnapshot)
Reverses clear_into_snapshot
by initializing the db’s state with the state snapshot.