pub struct ChainHash(/* private fields */);Expand description
A 32-byte chain link value: either a genesis seed or the output of chain_next.
Not secret (it is stored on disk alongside the content it authenticates), so Debug and
hex encode/decode are unrestricted. Equality compares via blake3::Hash, which is
constant-time — the same idiom already used for the promise resolver-token check and
verify_control_hmac, so a forged stored hash reveals no timing signal.
Implementations§
Source§impl ChainHash
impl ChainHash
Sourcepub fn from_hex(s: &str) -> Result<Self, ChainError>
pub fn from_hex(s: &str) -> Result<Self, ChainError>
Parse a lowercase (or uppercase) hex string produced by Self::to_hex.
§Errors
Returns ChainError::MalformedHash if s is not exactly 64 hex characters.
Trait Implementations§
impl Copy for ChainHash
impl Eq for ChainHash
Auto Trait Implementations§
impl Freeze for ChainHash
impl RefUnwindSafe for ChainHash
impl Send for ChainHash
impl Sync for ChainHash
impl Unpin for ChainHash
impl UnsafeUnpin for ChainHash
impl UnwindSafe for ChainHash
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