[−][src]Trait transact::state::Prune
state::Prune
provides a way to remove state ids from a particular state
storage system.
Removing StateIds
and the associated state makes it so the state storage
system does not grow unbounded.
Associated Types
type StateId
A reference to a checkpoint in state. It could be a merkle hash for a merkle database.
type Key
The Key that is being stored in state.
type Value
The Value that is being stored in state.
Required methods
fn prune(
&self,
state_ids: Vec<Self::StateId>
) -> Result<Vec<Self::Key>, StatePruneError>
&self,
state_ids: Vec<Self::StateId>
) -> Result<Vec<Self::Key>, StatePruneError>
Prune any State prior to the given StateId.
In storage mechanisms that have a concept of StateId
ordering, this
function should provide the functionality to prune older state values.
It can be considered a clean-up or space-saving mechanism.
It returns the keys that have been removed from state, if any.
Errors
StatePruneError is returned if any issues occur while trying to prune past results.