pub struct Digest { /* private fields */ }
Expand description
A calculated digest value.
Use Self::as_ref
to get the value as a &[u8]
.
Implementations§
Source§impl Digest
impl Digest
Sourcepub fn import_less_safe(
digest: &[u8],
algorithm: &'static Algorithm,
) -> Result<Self, Unspecified>
pub fn import_less_safe( digest: &[u8], algorithm: &'static Algorithm, ) -> Result<Self, Unspecified>
Imports a digest value provide by an external source. This allows for the signing of content that might not be directly accessible.
WARNING: Ensure that the digest is provided by a trusted source. When possible, prefer to directly compute the digest of content.
§Errors
Returns Unspecified
if the imported value is the wrong length for the specified algorithm.
Trait Implementations§
impl Copy 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 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