pub struct HashBuilder { /* private fields */ }Expand description
Fluent builder producing a boxed one-shot Hash instance.
Construct via one of the algorithm constructors (e.g. HashBuilder::sha256),
then call build for a Box<dyn Hash>, or switch to
streaming mode with streaming.
Implementations§
Source§impl HashBuilder
impl HashBuilder
Sourcepub const fn new(algorithm: HashAlgorithm) -> Self
pub const fn new(algorithm: HashAlgorithm) -> Self
Begin building with an explicit HashAlgorithm.
Sourcepub const fn sha512_256() -> Self
pub const fn sha512_256() -> Self
Select SHA-512/256.
Sourcepub const fn algorithm(&self) -> HashAlgorithm
pub const fn algorithm(&self) -> HashAlgorithm
The algorithm currently selected.
Sourcepub const fn streaming(self) -> StreamingHashBuilder
pub const fn streaming(self) -> StreamingHashBuilder
Switch to streaming mode, returning a StreamingHashBuilder.
Trait Implementations§
Source§impl Clone for HashBuilder
impl Clone for HashBuilder
Source§fn clone(&self) -> HashBuilder
fn clone(&self) -> HashBuilder
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for HashBuilder
impl Debug for HashBuilder
Source§impl PartialEq for HashBuilder
impl PartialEq for HashBuilder
Source§fn eq(&self, other: &HashBuilder) -> bool
fn eq(&self, other: &HashBuilder) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Copy for HashBuilder
impl Eq for HashBuilder
impl StructuralPartialEq for HashBuilder
Auto Trait Implementations§
impl Freeze for HashBuilder
impl RefUnwindSafe for HashBuilder
impl Send for HashBuilder
impl Sync for HashBuilder
impl Unpin for HashBuilder
impl UnsafeUnpin for HashBuilder
impl UnwindSafe for HashBuilder
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