Trait transact::state::Prune[][src]

pub trait Prune: Sync + Send + Clone {
    type StateId;
    type Key;
    type Value;
    fn prune(
        &self,
        state_ids: Vec<Self::StateId>
    ) -> Result<Vec<Self::Key>, StatePruneError>; }
Expand description

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

A reference to a checkpoint in state. It could be a merkle hash for a merkle database.

The Key that is being stored in state.

The Value that is being stored in state.

Required methods

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.

Implementors