pub struct StateManager {
    pub number_committed_nodes: AtomicUsize,
    /* private fields */
}

Fields§

§number_committed_nodes: AtomicUsize

Implementations§

source§

impl StateManager

source

pub fn new(conf: StorageConfiguration) -> Result<Self>

source

pub fn log_usage(&self)

source

pub fn get_storage_manager(&self) -> &StorageManager

source

pub fn get_storage_manager_arc(&self) -> &Arc<StorageManager>

source

pub fn get_state_trees_internal( snapshot_db: <SnapshotDbManagerSqlite as SnapshotDbManagerTrait>::SnapshotDb, snapshot_epoch_id: &EpochId, snapshot_merkle_root: MerkleHash, maybe_intermediate_trie: Option<Arc<DeltaMpt>>, maybe_intermediate_trie_key_padding: Option<&DeltaMptKeyPadding>, intermediate_epoch_id: &EpochId, intermediate_trie_root_merkle: MerkleHash, delta_mpt: Arc<DeltaMpt>, maybe_delta_mpt_key_padding: Option<&DeltaMptKeyPadding>, epoch_id: &EpochId, delta_root: Option<NodeRefDeltaMpt>, maybe_height: Option<u64>, maybe_delta_trie_height: Option<u32> ) -> Result<Option<StateTrees>>

delta_mpt_key_padding is required. When None is passed, it’s calculated for the state_trees.

source

pub fn get_state_trees( &self, state_index: &StateIndex, try_open: bool, open_mpt_snapshot: bool ) -> Result<Option<StateTrees>>

source

pub fn get_state_trees_for_next_epoch( &self, parent_state_index: &StateIndex, try_open: bool, open_mpt_snapshot: bool ) -> Result<Option<StateTrees>>

source

pub fn check_make_snapshot( &self, maybe_intermediate_trie: Option<Arc<DeltaMpt>>, intermediate_trie_root: Option<NodeRefDeltaMpt>, intermediate_epoch_id: &EpochId, new_height: u64, recover_mpt_during_construct_pivot_state: bool ) -> Result<()>

Check if we can make a new snapshot, and if so, make it in background.

source

pub fn get_state_no_commit_inner( self: &Arc<Self>, state_index: StateIndex, try_open: bool, open_mpt_snapshot: bool ) -> Result<Option<State>>

source

pub fn get_state_for_next_epoch_inner( self: &Arc<Self>, parent_epoch_id: StateIndex, open_mpt_snapshot: bool, recover_mpt_during_construct_pivot_state: bool ) -> Result<Option<State>>

source

pub fn notify_genesis_hash(&self, genesis_hash: EpochId)

source

pub fn config(&self) -> &StorageConfiguration

Trait Implementations§

source§

impl Drop for StateManager

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl MallocSizeOf for StateManager

source§

fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize

Measure the heap usage of all descendant heap-allocated structures, but not the space taken up by the value itself.
source§

impl StateManagerTrait for StateManager

source§

fn get_state_no_commit( self: &Arc<Self>, state_index: StateIndex, try_open: bool, space: Option<Space> ) -> Result<Option<Box<dyn StateTrait>>>

At the boundary of snapshot, getting a state for new epoch will switch to new Delta MPT, but it’s unnecessary getting a no-commit state. Read more
source§

fn get_state_for_genesis_write(self: &Arc<Self>) -> Box<dyn StateTrait>

source§

fn get_state_for_next_epoch( self: &Arc<Self>, parent_epoch_id: StateIndex, recover_mpt_during_construct_pivot_state: bool ) -> Result<Option<Box<dyn StateTrait>>>

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<T> ElementSatisfy<ElementNoConstrain> for T

source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

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> Same for T

§

type Output = T

Should always be Self
source§

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

§

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>,

§

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.
§

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

§

fn vzip(self) -> V