pub struct Sha1Digest(/* private fields */);Expand description
A 20-byte SHA-1 digest.
Used throughout crate::verify to carry both expected and computed
hashes. The newtype guarantees the length-of-20 invariant by construction —
no runtime length check, no Vec<u8> allocation per digest.
Display renders as 40 lowercase hex characters;
FromStr parses the same form (rejecting any input that is not exactly
40 hex characters).
Implementations§
Trait Implementations§
Source§impl Clone for Sha1Digest
impl Clone for Sha1Digest
Source§fn clone(&self) -> Sha1Digest
fn clone(&self) -> Sha1Digest
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 Sha1Digest
impl Debug for Sha1Digest
Source§impl<'de> Deserialize<'de> for Sha1Digest
impl<'de> Deserialize<'de> for Sha1Digest
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for Sha1Digest
impl Display for Sha1Digest
Source§impl From<Sha1Digest> for [u8; 20]
impl From<Sha1Digest> for [u8; 20]
Source§fn from(d: Sha1Digest) -> Self
fn from(d: Sha1Digest) -> Self
Converts to this type from the input type.
Source§impl FromStr for Sha1Digest
impl FromStr for Sha1Digest
Source§impl Hash for Sha1Digest
impl Hash for Sha1Digest
Source§impl PartialEq for Sha1Digest
impl PartialEq for Sha1Digest
Source§fn eq(&self, other: &Sha1Digest) -> bool
fn eq(&self, other: &Sha1Digest) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for Sha1Digest
impl Serialize for Sha1Digest
impl Copy for Sha1Digest
impl Eq for Sha1Digest
impl StructuralPartialEq for Sha1Digest
Auto Trait Implementations§
impl Freeze for Sha1Digest
impl RefUnwindSafe for Sha1Digest
impl Send for Sha1Digest
impl Sync for Sha1Digest
impl Unpin for Sha1Digest
impl UnsafeUnpin for Sha1Digest
impl UnwindSafe for Sha1Digest
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> CustomError for T
impl<T> CustomError for T
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