pub trait Accumulator<'a>{
type Proof;
// Required methods
fn prove(&'a self, item: &[u8]) -> Option<Self::Proof>;
fn check(&'a self, proof: Self::Proof, item: &[u8]) -> bool;
fn from_set(items: impl Iterator<Item = &'a [u8]>) -> Option<Self>;
}
Expand description
The Accumulator trait defines the interface for an accumulator.
This trait assumes an accumulator has an associated proof type that can be used to prove membership of a specific item. The choice to return Proof makes this the most generic implementation possible for any accumulator.
Required Associated Types§
Required Methods§
Sourcefn prove(&'a self, item: &[u8]) -> Option<Self::Proof>
fn prove(&'a self, item: &[u8]) -> Option<Self::Proof>
Prove an item is a member of the accumulator.
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.
Implementors§
Source§impl<'a> Accumulator<'a> for MulAccumulator<PrimeHasher>
impl<'a> Accumulator<'a> for MulAccumulator<PrimeHasher>
Source§impl<'a, H: Hasher + 'a> Accumulator<'a> for MerkleTree<H>
Presents an Accumulator friendly interface for MerkleTree.
impl<'a, H: Hasher + 'a> Accumulator<'a> for MerkleTree<H>
Presents an Accumulator friendly interface for MerkleTree.