pub struct MulAccumulator<H: Hasher> {
pub accumulator: H::Hash,
pub items: Vec<H::Hash>,
}
Expand description
A multiplication based Accumulator
This accumulator relies on the quasi-commutative nature of the multiplication operator. It’s
here mostly as a an example to gain intuition for how accumulators should function. This
implementation relies on the fact that /
can be used to “remove” an element but typically an
accumulator cannot rely on having a shortcut, and must re-accumulate sans the element being
proved to be a member.
Fields§
§accumulator: H::Hash
§items: Vec<H::Hash>
Trait Implementations§
Source§impl<'a> Accumulator<'a> for MulAccumulator<PrimeHasher>
impl<'a> Accumulator<'a> for MulAccumulator<PrimeHasher>
Auto Trait Implementations§
impl<H> Freeze for MulAccumulator<H>
impl<H> RefUnwindSafe for MulAccumulator<H>
impl<H> Send for MulAccumulator<H>
impl<H> Sync for MulAccumulator<H>
impl<H> Unpin for MulAccumulator<H>
impl<H> UnwindSafe for MulAccumulator<H>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more