pub enum JsonDigest {
Sha3([u8; 32]),
Blake3([u8; 32]),
}Expand description
A typed, parsed representation of a JSON digest string like "cjubdcpA0Ff..." or "cmursDCff...".
Each variant carries its own hash size — currently both 32 bytes, but future hashers with different output sizes can add variants without changing the public API.
Round-trips through [Display] / [FromStr] and supports serde and SCALE codec.
Variants§
Sha3([u8; 32])
SHA3-256 Merkle-tree hash (prefix cj).
Blake3([u8; 32])
BLAKE3-256 Merkle-tree hash (prefix cm).
Implementations§
Trait Implementations§
Source§impl Clone for JsonDigest
impl Clone for JsonDigest
impl Copy for JsonDigest
Source§impl Debug for JsonDigest
impl Debug for JsonDigest
Source§impl<'de> Deserialize<'de> for JsonDigest
impl<'de> Deserialize<'de> for JsonDigest
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for JsonDigest
impl Display for JsonDigest
impl Eq for JsonDigest
Source§impl FromStr for JsonDigest
impl FromStr for JsonDigest
Source§impl Hash for JsonDigest
impl Hash for JsonDigest
Source§impl Ord for JsonDigest
impl Ord for JsonDigest
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 JsonDigest
impl PartialEq for JsonDigest
Source§impl PartialOrd for JsonDigest
impl PartialOrd for JsonDigest
Source§impl Serialize for JsonDigest
impl Serialize for JsonDigest
impl StructuralPartialEq for JsonDigest
Auto Trait Implementations§
impl Freeze for JsonDigest
impl RefUnwindSafe for JsonDigest
impl Send for JsonDigest
impl Sync for JsonDigest
impl Unpin for JsonDigest
impl UnsafeUnpin for JsonDigest
impl UnwindSafe for JsonDigest
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