pub struct ContentDigest { /* private fields */ }Expand description
Optional algorithm-tagged content integrity digest.
A content revision or strong ETag is not automatically a digest. Callers construct this value
only when the remote backend supplies bytes produced by the named digest algorithm.
Implementations§
Source§impl ContentDigest
impl ContentDigest
Sourcepub fn new(
algorithm: ContentDigestAlgorithm,
value: impl Into<Vec<u8>>,
) -> Result<Self>
pub fn new( algorithm: ContentDigestAlgorithm, value: impl Into<Vec<u8>>, ) -> Result<Self>
Creates a non-empty algorithm-tagged digest.
§Errors
Returns an error when validation fails or an underlying backend, store, or platform operation fails.
Sourcepub const fn algorithm(&self) -> &ContentDigestAlgorithm
pub const fn algorithm(&self) -> &ContentDigestAlgorithm
Returns the digest algorithm identifier.
Sourcepub fn into_parts(self) -> (ContentDigestAlgorithm, Vec<u8>)
pub fn into_parts(self) -> (ContentDigestAlgorithm, Vec<u8>)
Consumes the digest and returns its algorithm and bytes.
Trait Implementations§
Source§impl Clone for ContentDigest
impl Clone for ContentDigest
Source§fn clone(&self) -> ContentDigest
fn clone(&self) -> ContentDigest
Returns a duplicate 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 ContentDigest
impl Debug for ContentDigest
Source§impl Hash for ContentDigest
impl Hash for ContentDigest
Source§impl PartialEq for ContentDigest
impl PartialEq for ContentDigest
impl Eq for ContentDigest
impl StructuralPartialEq for ContentDigest
Auto Trait Implementations§
impl Freeze for ContentDigest
impl RefUnwindSafe for ContentDigest
impl Send for ContentDigest
impl Sync for ContentDigest
impl Unpin for ContentDigest
impl UnwindSafe for ContentDigest
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