pub struct Standard<H: CHasher> { /* private fields */ }
Expand description
The standard hasher to use with an MMR for computing leaf, node and root digests. Leverages no external data.
Implementations§
Trait Implementations§
Source§impl<H: CHasher> Hasher<H> for Standard<H>
impl<H: CHasher> Hasher<H> for Standard<H>
Source§fn fork(&self) -> impl Hasher<H>
fn fork(&self) -> impl Hasher<H>
Fork the hasher to provide equivalent functionality in another thread. This is different
than Clone::clone because the forked hasher need not be a deep copy, and may share non-mutable
state with the hasher from which it was forked.
Source§fn leaf_digest(&mut self, pos: u64, element: &[u8]) -> H::Digest
fn leaf_digest(&mut self, pos: u64, element: &[u8]) -> H::Digest
Computes the digest for a leaf given its position and the element it represents.
Source§fn node_digest(
&mut self,
pos: u64,
left: &H::Digest,
right: &H::Digest,
) -> H::Digest
fn node_digest( &mut self, pos: u64, left: &H::Digest, right: &H::Digest, ) -> H::Digest
Computes the digest for a node given its position and the digests of its children.
Auto Trait Implementations§
impl<H> Freeze for Standard<H>where
H: Freeze,
impl<H> RefUnwindSafe for Standard<H>where
H: RefUnwindSafe,
impl<H> Send for Standard<H>
impl<H> Sync for Standard<H>
impl<H> Unpin for Standard<H>where
H: Unpin,
impl<H> UnwindSafe for Standard<H>where
H: UnwindSafe,
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
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more