pub struct IdentifierHash<T = [u8; 32]>(/* private fields */);Expand description
A domain-separated BLAKE3 identifier.
The default representation is the full 32-byte identifier. The generic parameter supports typed wrappers without changing the derivation API.
Implementations§
Source§impl<T> IdentifierHash<T>
impl<T> IdentifierHash<T>
Sourcepub fn into_inner(self) -> T
pub fn into_inner(self) -> T
Consume the identifier and return its wrapped representation.
Sourcepub fn map<U>(self, map: impl FnOnce(T) -> U) -> IdentifierHash<U>
pub fn map<U>(self, map: impl FnOnce(T) -> U) -> IdentifierHash<U>
Transform the representation while preserving the identifier’s domain.
This is the safe construction path for non-default generic specializations: callers first derive or validate an identifier, then map its representation without reinterpreting unrelated bytes.
Source§impl IdentifierHash<[u8; 32]>
impl IdentifierHash<[u8; 32]>
Sourcepub fn derive(context: &'static str, value: &[u8]) -> Self
pub fn derive(context: &'static str, value: &[u8]) -> Self
Derive an identifier within a fixed application context.
Callers must use a stable, purpose-specific context constant. BLAKE3’s derive-key mode provides the domain separation; callers do not need to construct ad-hoc byte prefixes.
Sourcepub const fn from_bytes(bytes: [u8; 32]) -> Self
pub const fn from_bytes(bytes: [u8; 32]) -> Self
Create an identifier from its full byte representation.
Sourcepub fn to_prefixed_hex(&self) -> String
pub fn to_prefixed_hex(&self) -> String
Encode as blake3:<lowercase hex>.
Trait Implementations§
Source§impl<T: Clone> Clone for IdentifierHash<T>
impl<T: Clone> Clone for IdentifierHash<T>
Source§fn clone(&self) -> IdentifierHash<T>
fn clone(&self) -> IdentifierHash<T>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl<T: Copy> Copy for IdentifierHash<T>
impl<T: Eq> Eq for IdentifierHash<T>
Source§impl<T: Hash> Hash for IdentifierHash<T>
impl<T: Hash> Hash for IdentifierHash<T>
Source§impl<T: PartialEq> PartialEq for IdentifierHash<T>
impl<T: PartialEq> PartialEq for IdentifierHash<T>
impl<T: PartialEq> StructuralPartialEq for IdentifierHash<T>
Auto Trait Implementations§
impl<T> Freeze for IdentifierHash<T>where
T: Freeze,
impl<T> RefUnwindSafe for IdentifierHash<T>where
T: RefUnwindSafe,
impl<T> Send for IdentifierHash<T>where
T: Send,
impl<T> Sync for IdentifierHash<T>where
T: Sync,
impl<T> Unpin for IdentifierHash<T>where
T: Unpin,
impl<T> UnsafeUnpin for IdentifierHash<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for IdentifierHash<T>where
T: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> ToHex for T
impl<T> ToHex for T
Source§fn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
self into the result. Lower case
letters are used (e.g. f9b4ca)Source§fn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
self into the result. Upper case
letters are used (e.g. F9B4CA)