pub struct Digest(/* private fields */);Expand description
A canonical integrity digest.
SHA-256 is mandatory in v1. The stable wire form is exactly
sha256:<64 lowercase hexadecimal digits>.
Implementations§
Source§impl Digest
impl Digest
Sourcepub const SHA256_LEN: usize = 32
pub const SHA256_LEN: usize = 32
Length of a SHA-256 digest in bytes.
Sourcepub const fn from_sha256(bytes: [u8; 32]) -> Self
pub const fn from_sha256(bytes: [u8; 32]) -> Self
Constructs a digest from a previously computed SHA-256 value.
Sourcepub const fn algorithm(self) -> DigestAlgorithm
pub const fn algorithm(self) -> DigestAlgorithm
Returns the digest algorithm.
Trait Implementations§
impl Copy for Digest
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
Source§impl JsonSchema for Digest
impl JsonSchema for Digest
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(_: &mut SchemaGenerator) -> Schema
fn json_schema(_: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreSource§impl Ord for Digest
impl Ord for Digest
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 PartialOrd for Digest
impl PartialOrd for Digest
impl StructuralPartialEq for Digest
Auto Trait Implementations§
impl Forget for Digest
impl Freeze for Digest
impl Move 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