pub struct CredentialHash(/* private fields */);Expand description
SHA-256 digest of a credential.
This is intentionally distinct from other 32-byte digests in the system
(Merkle content hashes, detector-set hashes, verifier cache internals). A
credential hash can suppress findings, correlate reports, and cross detector
boundaries; keeping it named prevents those contracts from blending into
arbitrary [u8; 32] arrays.
Implementations§
Source§impl CredentialHash
impl CredentialHash
Sourcepub const ZERO: Self
pub const ZERO: Self
All-zero hash used only as a compatibility sentinel for historical test constructors and old serialized fixtures that omitted real hashes.
Sourcepub const fn from_bytes(bytes: [u8; 32]) -> Self
pub const fn from_bytes(bytes: [u8; 32]) -> Self
Construct from raw SHA-256 bytes.
Sourcepub const fn into_bytes(self) -> [u8; 32]
pub const fn into_bytes(self) -> [u8; 32]
Return the raw SHA-256 bytes.
Trait Implementations§
Source§impl AsRef<[u8]> for CredentialHash
impl AsRef<[u8]> for CredentialHash
Source§impl Clone for CredentialHash
impl Clone for CredentialHash
Source§fn clone(&self) -> CredentialHash
fn clone(&self) -> CredentialHash
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 moreimpl Copy for CredentialHash
Source§impl Debug for CredentialHash
impl Debug for CredentialHash
Source§impl Default for CredentialHash
impl Default for CredentialHash
Source§fn default() -> CredentialHash
fn default() -> CredentialHash
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for CredentialHash
impl<'de> Deserialize<'de> for CredentialHash
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
impl Eq for CredentialHash
Source§impl From<CredentialHash> for [u8; 32]
impl From<CredentialHash> for [u8; 32]
Source§fn from(hash: CredentialHash) -> Self
fn from(hash: CredentialHash) -> Self
Converts to this type from the input type.
Source§impl Hash for CredentialHash
impl Hash for CredentialHash
Source§impl Ord for CredentialHash
impl Ord for CredentialHash
Source§fn cmp(&self, other: &CredentialHash) -> Ordering
fn cmp(&self, other: &CredentialHash) -> 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 CredentialHash
impl PartialEq for CredentialHash
Source§impl PartialOrd for CredentialHash
impl PartialOrd for CredentialHash
Source§impl Serialize for CredentialHash
impl Serialize for CredentialHash
impl StructuralPartialEq for CredentialHash
Auto Trait Implementations§
impl Freeze for CredentialHash
impl RefUnwindSafe for CredentialHash
impl Send for CredentialHash
impl Sync for CredentialHash
impl Unpin for CredentialHash
impl UnsafeUnpin for CredentialHash
impl UnwindSafe for CredentialHash
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
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>,
Encode the hex strict representing
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>,
Encode the hex strict representing
self into the result. Upper case
letters are used (e.g. F9B4CA)