pub trait StateManagerTrait {
    // Required methods
    fn get_state_no_commit(
        self: &Arc<Self>,
        epoch_id: StateIndex,
        try_open: bool,
        space: Option<Space>
    ) -> Result<Option<Box<dyn StateTrait>>>;
    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>>>;
    fn get_state_for_genesis_write(self: &Arc<Self>) -> Box<dyn StateTrait>;
}

Required Methods§

source

fn get_state_no_commit( self: &Arc<Self>, epoch_id: 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.

With try_open == true, the call fails immediately when the max number of snapshot open is reached.

If space is None, we need data from all spaces.

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

source

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

Object Safety§

This trait is not object safe.

Implementors§