pub enum CacheEntryKeyRef<'a> {
KeyOnly(&'a CompactCacheKey),
Identified {
key: &'a CompactCacheKey,
id: CacheEntryId,
},
}Expand description
A borrowed cache entry identity used for exact eviction-manager lookups.
This type hashes identically to the equivalent owned CacheEntryKey.
Variants§
KeyOnly(&'a CompactCacheKey)
An entry identified only by its logical cache key.
Identified
An entry with additional storage-defined identity.
Fields
§
key: &'a CompactCacheKeyThe logical cache key.
§
id: CacheEntryIdThe storage-defined entry ID.
Implementations§
Source§impl<'a> CacheEntryKeyRef<'a>
impl<'a> CacheEntryKeyRef<'a>
Sourcepub fn from_entry_id(key: &'a CompactCacheKey, id: Option<CacheEntryId>) -> Self
pub fn from_entry_id(key: &'a CompactCacheKey, id: Option<CacheEntryId>) -> Self
Construct a borrowed entry identity from its logical key and storage-defined ID, if any.
The ID must match the entry originally admitted to an eviction manager. A different ID is a different entry and will not remove or otherwise match the admitted entry.
Sourcepub fn key(self) -> &'a CompactCacheKey
pub fn key(self) -> &'a CompactCacheKey
Return the underlying cache key.
Sourcepub fn entry_id(self) -> Option<CacheEntryId>
pub fn entry_id(self) -> Option<CacheEntryId>
Return the storage-defined entry ID, if present.
Trait Implementations§
Source§impl<'a> Clone for CacheEntryKeyRef<'a>
impl<'a> Clone for CacheEntryKeyRef<'a>
Source§fn clone(&self) -> CacheEntryKeyRef<'a>
fn clone(&self) -> CacheEntryKeyRef<'a>
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<'a> Copy for CacheEntryKeyRef<'a>
Source§impl<'a> Debug for CacheEntryKeyRef<'a>
impl<'a> Debug for CacheEntryKeyRef<'a>
Source§impl Display for CacheEntryKeyRef<'_>
impl Display for CacheEntryKeyRef<'_>
impl<'a> Eq for CacheEntryKeyRef<'a>
Source§impl<'a> From<&'a CacheEntryKey> for CacheEntryKeyRef<'a>
impl<'a> From<&'a CacheEntryKey> for CacheEntryKeyRef<'a>
Source§fn from(entry: &'a CacheEntryKey) -> Self
fn from(entry: &'a CacheEntryKey) -> Self
Converts to this type from the input type.
Source§impl<'a> Hash for CacheEntryKeyRef<'a>
impl<'a> Hash for CacheEntryKeyRef<'a>
Source§impl<'a> PartialEq for CacheEntryKeyRef<'a>
impl<'a> PartialEq for CacheEntryKeyRef<'a>
impl<'a> StructuralPartialEq for CacheEntryKeyRef<'a>
Auto Trait Implementations§
impl<'a> Freeze for CacheEntryKeyRef<'a>
impl<'a> RefUnwindSafe for CacheEntryKeyRef<'a>
impl<'a> Send for CacheEntryKeyRef<'a>
impl<'a> Sync for CacheEntryKeyRef<'a>
impl<'a> Unpin for CacheEntryKeyRef<'a>
impl<'a> UnsafeUnpin for CacheEntryKeyRef<'a>
impl<'a> UnwindSafe for CacheEntryKeyRef<'a>
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> 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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.