pub struct CacheKey(/* private fields */);Expand description
The cache-key identity of a task under a given set of inputs
(CACHE-001).
Width is 32 bytes: both specification-recognised hash functions
(CACHE-002) emit 32-byte digests. A future hash function with
a different width would require a chapter revision (CACHE-003)
and is out of scope here.
CacheKey is Copy because its only field is a 32-byte
array; passing it by value avoids accidental borrow lifetimes
in caller code that threads keys through scheduling layers.
Implementations§
Source§impl CacheKey
impl CacheKey
Sourcepub const fn from_bytes(bytes: [u8; 32]) -> Self
pub const fn from_bytes(bytes: [u8; 32]) -> Self
Wrap bytes directly as a CacheKey. Intended for callers
that already obtained 32 bytes from a trusted source (e.g.
hex-decoded manifest, network protocol). The cache library’s
invariants on a key are byte-level only; no further checking
is performed.
Trait Implementations§
impl Copy for CacheKey
impl Eq for CacheKey
impl StructuralPartialEq for CacheKey
Auto Trait Implementations§
impl Freeze for CacheKey
impl RefUnwindSafe for CacheKey
impl Send for CacheKey
impl Sync for CacheKey
impl Unpin for CacheKey
impl UnsafeUnpin for CacheKey
impl UnwindSafe for CacheKey
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