Struct mini_functions::hash::models::hash::HashBuilder
source · pub struct HashBuilder { /* private fields */ }
Expand description
A builder struct for the Hash
struct.
It contains optional fields that correspond to the fields in Hash
.
The #[derive(Default)]
allows us to initialize all fields to None
.
Implementations§
source§impl HashBuilder
impl HashBuilder
sourcepub fn new() -> HashBuilder
pub fn new() -> HashBuilder
Creates a new HashBuilder
with all fields set to None
.
sourcepub fn hash(self, hash: Vec<u8>) -> HashBuilder
pub fn hash(self, hash: Vec<u8>) -> HashBuilder
Sets the hash
field in the builder.
The self
parameter is consumed and returned to allow for method chaining.
sourcepub fn salt(self, salt: Vec<u8>) -> HashBuilder
pub fn salt(self, salt: Vec<u8>) -> HashBuilder
Sets the salt
field in the builder.
The self
parameter is consumed and returned to allow for method chaining.
sourcepub fn algorithm(self, algorithm: HashAlgorithm) -> HashBuilder
pub fn algorithm(self, algorithm: HashAlgorithm) -> HashBuilder
Sets the algorithm
field in the builder.
The self
parameter is consumed and returned to allow for method chaining.
Trait Implementations§
source§impl Clone for HashBuilder
impl Clone for HashBuilder
source§fn clone(&self) -> HashBuilder
fn clone(&self) -> HashBuilder
Returns a copy of the value. Read more
1.0.0 · 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 Default for HashBuilder
impl Default for HashBuilder
Creates a new HashBuilder
with all fields set to None
.
source§fn default() -> HashBuilder
fn default() -> HashBuilder
Returns the “default value” for a type. Read more
source§impl<'de> Deserialize<'de> for HashBuilder
impl<'de> Deserialize<'de> for HashBuilder
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<HashBuilder, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<HashBuilder, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Hash for HashBuilder
impl Hash for HashBuilder
source§impl Ord for HashBuilder
impl Ord for HashBuilder
source§fn cmp(&self, other: &HashBuilder) -> Ordering
fn cmp(&self, other: &HashBuilder) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialEq for HashBuilder
impl PartialEq for HashBuilder
source§fn eq(&self, other: &HashBuilder) -> bool
fn eq(&self, other: &HashBuilder) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for HashBuilder
impl PartialOrd for HashBuilder
source§fn partial_cmp(&self, other: &HashBuilder) -> Option<Ordering>
fn partial_cmp(&self, other: &HashBuilder) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl Serialize for HashBuilder
impl Serialize for HashBuilder
source§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl Eq for HashBuilder
impl StructuralEq for HashBuilder
impl StructuralPartialEq for HashBuilder
Auto Trait Implementations§
impl RefUnwindSafe for HashBuilder
impl Send for HashBuilder
impl Sync for HashBuilder
impl Unpin 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
§impl<T> FromBase64 for Twhere
T: for<'de> Deserialize<'de>,
impl<T> FromBase64 for Twhere
T: for<'de> Deserialize<'de>,
§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian()
.