pub struct HashLength(/* private fields */);
Expand description
A newtype wrapper for specifying the length of a hash value. The internal value represents the number of characters the hash should be.
Implementations§
Source§impl HashLength
impl HashLength
Sourcepub fn new(length: usize) -> Result<Self, HashLengthError>
pub fn new(length: usize) -> Result<Self, HashLengthError>
Creates a new HashLength
instance.
§Arguments
length
- The desired length of the hash in characters
§Returns
Ok(HashLength)
if length is valid (>=HASH_LENGTH_MINIMUM
, which is8
)Err(HashLengthError)
if length is too short
Trait Implementations§
Source§impl Clone for HashLength
impl Clone for HashLength
Source§fn clone(&self) -> HashLength
fn clone(&self) -> HashLength
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 HashLength
impl Debug for HashLength
Source§impl PartialEq for HashLength
impl PartialEq for HashLength
Source§impl TryFrom<usize> for HashLength
impl TryFrom<usize> for HashLength
Source§type Error = HashLengthError
type Error = HashLengthError
The type returned in the event of a conversion error.
impl Copy for HashLength
impl StructuralPartialEq for HashLength
Auto Trait Implementations§
impl Freeze for HashLength
impl RefUnwindSafe for HashLength
impl Send for HashLength
impl Sync for HashLength
impl Unpin for HashLength
impl UnwindSafe for HashLength
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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