pub struct Digest { /* private fields */ }Expand description
Content-addressed identifier in <algo>:<hex> form.
With the serde feature enabled, Digest serializes and
deserializes via its wire <algo>:<hex> string form.
Implementations§
Source§impl Digest
impl Digest
Sourcepub fn new(
algo: DigestAlgo,
hex: impl Into<String>,
) -> Result<Self, DigestParseError>
pub fn new( algo: DigestAlgo, hex: impl Into<String>, ) -> Result<Self, DigestParseError>
Construct from a known algorithm and hex string. Validates the hex length and character set.
Sourcepub const fn algo(&self) -> DigestAlgo
pub const fn algo(&self) -> DigestAlgo
Algorithm this digest was produced with.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Digest
impl<'de> Deserialize<'de> for Digest
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
impl Eq for Digest
impl StructuralPartialEq for Digest
Auto Trait Implementations§
impl Freeze for Digest
impl RefUnwindSafe for Digest
impl Send for Digest
impl Sync for Digest
impl Unpin for Digest
impl UnsafeUnpin for Digest
impl UnwindSafe for Digest
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