pub trait CleanStore: LogStore {
type Digest: Digest;
type Operation;
type Dirty: DirtyStore<Digest = Self::Digest, Operation = Self::Operation, Clean = Self, Value = Self::Value>;
// Required methods
fn root(&self) -> Self::Digest;
fn proof(
&self,
start_loc: Location,
max_ops: NonZeroU64,
) -> impl Future<Output = Result<(Proof<Self::Digest>, Vec<Self::Operation>), Error>>;
fn historical_proof(
&self,
historical_size: Location,
start_loc: Location,
max_ops: NonZeroU64,
) -> impl Future<Output = Result<(Proof<Self::Digest>, Vec<Self::Operation>), Error>>;
fn into_dirty(self) -> Self::Dirty;
}Expand description
A trait for authenticated stores in a “clean” state where the MMR root is computed.
Required Associated Types§
Required Methods§
Sourcefn proof(
&self,
start_loc: Location,
max_ops: NonZeroU64,
) -> impl Future<Output = Result<(Proof<Self::Digest>, Vec<Self::Operation>), Error>>
fn proof( &self, start_loc: Location, max_ops: NonZeroU64, ) -> impl Future<Output = Result<(Proof<Self::Digest>, Vec<Self::Operation>), Error>>
Generate and return:
- a proof of all operations applied to the store in the range starting at (and including)
location
start_loc, and ending at the first of either:- the last operation performed, or
- the operation
max_opsfrom the start.
- the operations corresponding to the leaves in this range.
§Errors
Returns crate::mmr::Error::LocationOverflow if start_loc > crate::mmr::MAX_LOCATION.
Returns crate::mmr::Error::RangeOutOfBounds if start_loc >= op_count.
Sourcefn historical_proof(
&self,
historical_size: Location,
start_loc: Location,
max_ops: NonZeroU64,
) -> impl Future<Output = Result<(Proof<Self::Digest>, Vec<Self::Operation>), Error>>
fn historical_proof( &self, historical_size: Location, start_loc: Location, max_ops: NonZeroU64, ) -> impl Future<Output = Result<(Proof<Self::Digest>, Vec<Self::Operation>), Error>>
Generate and return:
- a proof of all operations applied to the store in the range starting at (and including)
location
start_loc, and ending at the first of either:- the last operation performed, or
- the operation
max_opsfrom the start.
- the operations corresponding to the leaves in this range.
for the store when it had historical_size operations.
§Errors
Returns crate::mmr::Error::LocationOverflow if start_loc > crate::mmr::MAX_LOCATION.
Returns crate::mmr::Error::RangeOutOfBounds if start_loc >= op_count.
Sourcefn into_dirty(self) -> Self::Dirty
fn into_dirty(self) -> Self::Dirty
Convert this clean store into its dirty counterpart for batched updates.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.