pub struct ContentDigest { /* private fields */ }Expand description
A versioned unkeyed content digest.
Implementations§
Source§impl ContentDigest
impl ContentDigest
Sourcepub const fn from_stored_parts(
scheme: u8,
domain: HashDomain,
bytes: [u8; 32],
) -> Option<Self>
pub const fn from_stored_parts( scheme: u8, domain: HashDomain, bytes: [u8; 32], ) -> Option<Self>
Reconstructs a supported stored digest representation.
This checks the scheme only. It does not verify a preimage, publication, source ancestry, or authority. Callers must check the expected domain and independently verify the authoritative bytes before using the digest.
Sourcepub const fn domain(self) -> HashDomain
pub const fn domain(self) -> HashDomain
Returns the immutable semantic domain used to calculate the digest.
Trait Implementations§
Source§impl Clone for ContentDigest
impl Clone for ContentDigest
impl Copy for ContentDigest
Source§impl Debug for ContentDigest
impl Debug for ContentDigest
impl Eq for ContentDigest
Source§impl Hash for ContentDigest
impl Hash for ContentDigest
Source§impl Ord for ContentDigest
impl Ord for ContentDigest
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialEq for ContentDigest
impl PartialEq for ContentDigest
Source§impl PartialOrd for ContentDigest
impl PartialOrd 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 UnsafeUnpin 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