Skip to main content

DynStreamingHash

Enum DynStreamingHash 

Source
pub enum DynStreamingHash {
    Sha256(Sha256Streaming),
    Sha384(Sha384Streaming),
    Sha512(Sha512Streaming),
    Sha512_256(Sha512_256Streaming),
    Sha3_256(Sha3_256Streaming),
    Sha3_384(Sha3_384Streaming),
    Sha3_512(Sha3_512Streaming),
    Blake3(Box<Blake3Streaming>),
}
Expand description

Runtime-dispatched streaming hasher returned by StreamingHashBuilder::build.

This is a sized enum (not a Box<dyn StreamingHash>): a boxed trait object could not be passed to StreamingHash::finalize, which consumes self by value and therefore requires a Sized receiver. DynStreamingHash itself implements StreamingHash, dispatching to the wrapped concrete hasher.

Variants§

§

Sha256(Sha256Streaming)

Streaming SHA-256.

§

Sha384(Sha384Streaming)

Streaming SHA-384.

§

Sha512(Sha512Streaming)

Streaming SHA-512.

§

Sha512_256(Sha512_256Streaming)

Streaming SHA-512/256.

§

Sha3_256(Sha3_256Streaming)

Streaming SHA3-256.

§

Sha3_384(Sha3_384Streaming)

Streaming SHA3-384.

§

Sha3_512(Sha3_512Streaming)

Streaming SHA3-512.

§

Blake3(Box<Blake3Streaming>)

Streaming BLAKE3.

Boxed because blake3::Hasher is far larger than the digest-based streaming states, which would otherwise bloat every enum value.

Implementations§

Source§

impl DynStreamingHash

Source

pub const fn algorithm(&self) -> HashAlgorithm

The HashAlgorithm this streaming hasher computes.

Trait Implementations§

Source§

impl Debug for DynStreamingHash

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl StreamingHash for DynStreamingHash

Source§

fn update(&mut self, data: &[u8])

Feed additional data into the hash state.
Source§

fn finalize(self, out: &mut [u8]) -> Result<(), CryptoError>

Consume the hasher and write the final digest into out. Read more
Source§

fn reset(&mut self)

Reset the hasher to its initial state, allowing reuse.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.