pub struct SubjectKey(/* private fields */);Expand description
An opaque, fixed-width subject identifier used by storage backends.
The inner digest is intentionally omitted from Debug output. Construct
keys with KeyHasher unless the input is already a cryptographically
opaque 32-byte digest.
This type deliberately does not implement Serde traits, even when the
crate’s serde feature is enabled, to avoid accidental key disclosure.
Implementations§
Source§impl SubjectKey
impl SubjectKey
Sourcepub const fn from_digest(digest: [u8; 32]) -> Self
pub const fn from_digest(digest: [u8; 32]) -> Self
Constructs a key from an already-opaque 32-byte digest.
This constructor does not hash or otherwise transform the input.
Sourcepub const fn as_bytes(&self) -> &[u8; 32]
pub const fn as_bytes(&self) -> &[u8; 32]
Returns the opaque digest bytes for storage and comparison.
Sourcepub const fn into_bytes(self) -> [u8; 32]
pub const fn into_bytes(self) -> [u8; 32]
Consumes the key and returns its opaque digest bytes.
Trait Implementations§
Source§impl Clone for SubjectKey
impl Clone for SubjectKey
Source§fn clone(&self) -> SubjectKey
fn clone(&self) -> SubjectKey
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 SubjectKey
Source§impl Debug for SubjectKey
impl Debug for SubjectKey
impl Eq for SubjectKey
Source§impl Hash for SubjectKey
impl Hash for SubjectKey
Source§impl Ord for SubjectKey
impl Ord for SubjectKey
Source§fn cmp(&self, other: &SubjectKey) -> Ordering
fn cmp(&self, other: &SubjectKey) -> 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 SubjectKey
impl PartialEq for SubjectKey
Source§impl PartialOrd for SubjectKey
impl PartialOrd for SubjectKey
impl StructuralPartialEq for SubjectKey
Auto Trait Implementations§
impl Freeze for SubjectKey
impl RefUnwindSafe for SubjectKey
impl Send for SubjectKey
impl Sync for SubjectKey
impl Unpin for SubjectKey
impl UnsafeUnpin for SubjectKey
impl UnwindSafe for SubjectKey
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