pub struct ContentDigest { /* private fields */ }Expand description
A BLAKE3 content digest with explicit identity context.
Implementations§
Source§impl ContentDigest
impl ContentDigest
Sourcepub fn compute_str(data: &str) -> Self
pub fn compute_str(data: &str) -> Self
Computes a domain-separated digest from a UTF-8 string.
Sourcepub fn compute_json<T: Serialize + ?Sized>(
value: &T,
) -> Result<Self, DigestError>
pub fn compute_json<T: Serialize + ?Sized>( value: &T, ) -> Result<Self, DigestError>
Computes an RFC 8785 digest using the default JSON schema identity.
Sourcepub fn compute_json_with_schema<T: Serialize + ?Sized>(
value: &T,
schema_id: impl Into<String>,
schema_version: impl Into<String>,
) -> Result<Self, DigestError>
pub fn compute_json_with_schema<T: Serialize + ?Sized>( value: &T, schema_id: impl Into<String>, schema_version: impl Into<String>, ) -> Result<Self, DigestError>
Computes an RFC 8785 digest bound to a schema ID and version.
Sourcepub fn metadata(&self) -> &DigestMetadata
pub fn metadata(&self) -> &DigestMetadata
Returns the identity context bound into the digest.
Sourcepub fn from_hex(hex: impl Into<String>) -> Result<Self, DigestError>
pub fn from_hex(hex: impl Into<String>) -> Result<Self, DigestError>
Creates a raw-byte digest wrapper from validated hex.
Sourcepub fn from_hex_unchecked(hex: impl Into<String>) -> Self
pub fn from_hex_unchecked(hex: impl Into<String>) -> Self
Creates a raw-byte digest wrapper without validating its hex.
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 (const: unstable) · 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<'de> Deserialize<'de> for ContentDigest
impl<'de> Deserialize<'de> for ContentDigest
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
Source§impl Display for ContentDigest
impl Display for ContentDigest
impl Eq for ContentDigest
Source§impl Hash for ContentDigest
impl Hash for ContentDigest
Source§impl JsonSchema for ContentDigest
impl JsonSchema for ContentDigest
Source§fn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the
$ref keyword. Read moreSource§impl Ord for ContentDigest
impl Ord for ContentDigest
Source§fn cmp(&self, other: &ContentDigest) -> Ordering
fn cmp(&self, other: &ContentDigest) -> Ordering
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
Source§impl PartialEq for ContentDigest
impl PartialEq for ContentDigest
Source§impl PartialOrd for ContentDigest
impl PartialOrd for ContentDigest
Source§impl Serialize for ContentDigest
impl Serialize 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