pub struct ContentHash(/* private fields */);Expand description
A 32-byte content address (BLAKE3 hash).
Distinct from NodeId at the type level; identical on the wire. Named
ContentHash (not Hash) to avoid colliding with decdn_config_types::Hash
and the std::hash::Hash trait.
Implementations§
Source§impl ContentHash
impl ContentHash
Sourcepub const fn from_bytes(bytes: [u8; 32]) -> Self
pub const fn from_bytes(bytes: [u8; 32]) -> Self
Wrap raw bytes. const to keep the newtype usable in const
contexts (and consistent with the sibling accessors below).
Trait Implementations§
Source§impl Clone for ContentHash
impl Clone for ContentHash
impl Copy for ContentHash
Source§impl Debug for ContentHash
impl Debug for ContentHash
Source§impl<'de> Deserialize<'de> for ContentHash
impl<'de> Deserialize<'de> for ContentHash
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 ContentHash
Lowercase hex with no prefix — the same rendering as
iroh::PublicKey and iroh_blobs::Hash, so a log or span field
written from this type matches one written from the iroh type.
impl Display for ContentHash
Lowercase hex with no prefix — the same rendering as
iroh::PublicKey and iroh_blobs::Hash, so a log or span field
written from this type matches one written from the iroh type.
impl Eq for ContentHash
Source§impl From<ContentHash> for [u8; 32]
impl From<ContentHash> for [u8; 32]
Source§fn from(value: ContentHash) -> Self
fn from(value: ContentHash) -> Self
Converts to this type from the input type.
Source§impl Hash for ContentHash
impl Hash for ContentHash
Source§impl Ord for ContentHash
impl Ord for ContentHash
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 ContentHash
impl PartialEq for ContentHash
Source§impl PartialOrd for ContentHash
impl PartialOrd for ContentHash
Source§impl Serialize for ContentHash
impl Serialize for ContentHash
impl StructuralPartialEq for ContentHash
Auto Trait Implementations§
impl Freeze for ContentHash
impl RefUnwindSafe for ContentHash
impl Send for ContentHash
impl Sync for ContentHash
impl Unpin for ContentHash
impl UnsafeUnpin for ContentHash
impl UnwindSafe for ContentHash
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