pub trait ParallelDigest: Send {
type Digest: Digest + Send;
// Required methods
fn new() -> Self;
fn new_with_prefix(data: impl AsRef<[u8]>) -> Self;
fn digest<I: IntoIterator<Item: SerializeBytes>>(
&self,
source: impl IndexedParallelIterator<Item = I>,
out: &mut [MaybeUninit<Output<Self::Digest>>],
);
}Required Associated Types§
Required Methods§
Sourcefn new_with_prefix(data: impl AsRef<[u8]>) -> Self
fn new_with_prefix(data: impl AsRef<[u8]>) -> Self
Create new hasher instance which has processed the provided data.
Sourcefn digest<I: IntoIterator<Item: SerializeBytes>>(
&self,
source: impl IndexedParallelIterator<Item = I>,
out: &mut [MaybeUninit<Output<Self::Digest>>],
)
fn digest<I: IntoIterator<Item: SerializeBytes>>( &self, source: impl IndexedParallelIterator<Item = I>, out: &mut [MaybeUninit<Output<Self::Digest>>], )
Calculate the digest of multiple hashes by processing a parallel iterator of iterators.
The source parameter provides a parallel iterator where:
- Each element of the outer iterator maps to one leaf/digest in the output
- Each element contains an inner iterator of items that will be serialized and concatenated to form that leaf’s content
§Panics
All items must be able to serialize with SerializationMode::Native without error, or this method will panic.
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.