pub struct Blake3;
Expand description
Provides a Blake3 Hasher for the MerkleTree.
Trait Implementations
sourceimpl Hasher for Blake3
impl Hasher for Blake3
type Hash = RawId
type Hash = RawId
This type is used as a hash type in the library.
It is recommended to use fixed size u8 array as a hash type. For example,
for sha256 the type would be [u8; 32]
, representing 32 bytes,
which is the size of the sha256 digest. Also, fixed sized arrays of u8
by default satisfy all trait bounds required by this type. Read more
sourcefn hash(data: &[u8]) -> Self::Hash
fn hash(data: &[u8]) -> Self::Hash
This associated function takes a slice of bytes and returns a hash of it.
Used by concat_and_hash
function to build a tree from concatenated hashes Read more
sourcefn concat_and_hash(left: &Self::Hash, right: Option<&Self::Hash>) -> Self::Hash
fn concat_and_hash(left: &Self::Hash, right: Option<&Self::Hash>) -> Self::Hash
Used by MerkleTree
and PartialTree
when calculating the root.
The provided default implementation propagates the left node if it doesn’t
have a sibling. The left node should always be present. The right node is optional. Read more
Auto Trait Implementations
impl RefUnwindSafe for Blake3
impl Send for Blake3
impl Sync for Blake3
impl Unpin for Blake3
impl UnwindSafe for Blake3
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more