pub struct ParallelDigestAdapter<D>(/* private fields */);Expand description
Adapts a sequential [Digest] into a ParallelDigest that hashes one leaf per element of a
parallel iterator.
Each Rayon work-item is seeded with a single hasher (via for_each_with) which is recycled in
place with finalize_reset between leaves, rather than cloning a fresh hasher per leaf. This
requires D: FixedOutputReset.
Trait Implementations§
Source§impl<D> Default for ParallelDigestAdapter<D>
impl<D> Default for ParallelDigestAdapter<D>
Source§impl<D> ParallelDigest for ParallelDigestAdapter<D>
impl<D> ParallelDigest for ParallelDigestAdapter<D>
Source§fn 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. Read more
Source§fn digest_with_const_len<I: IntoIterator<Item: FixedSizeSerializeBytes>>(
&self,
n_items_per_input: usize,
source: impl IndexedParallelIterator<Item = I>,
out: &mut [MaybeUninit<Output<Self::Digest>>],
)
fn digest_with_const_len<I: IntoIterator<Item: FixedSizeSerializeBytes>>( &self, n_items_per_input: usize, source: impl IndexedParallelIterator<Item = I>, out: &mut [MaybeUninit<Output<Self::Digest>>], )
Auto Trait Implementations§
impl<D> Freeze for ParallelDigestAdapter<D>
impl<D> RefUnwindSafe for ParallelDigestAdapter<D>where
D: RefUnwindSafe,
impl<D> Send for ParallelDigestAdapter<D>where
D: Send,
impl<D> Sync for ParallelDigestAdapter<D>where
D: Sync,
impl<D> Unpin for ParallelDigestAdapter<D>where
D: Unpin,
impl<D> UnsafeUnpin for ParallelDigestAdapter<D>
impl<D> UnwindSafe for ParallelDigestAdapter<D>where
D: 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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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