pub enum CacheEntryKey {
KeyOnly(CompactCacheKey),
Identified {
key: CompactCacheKey,
id: CacheEntryId,
},
}Expand description
The identity of an entry tracked by an eviction manager.
Identified entries combine a logical cache key with storage-defined entry identity. Eviction managers paired with storage that returns identified entries must preserve and compare the complete key. Managers that use only the compact key cannot correctly account for such storage.
Variants§
KeyOnly(CompactCacheKey)
An entry identified only by its logical cache key.
Identified
An entry with additional storage-defined identity.
Implementations§
Source§impl CacheEntryKey
impl CacheEntryKey
Sourcepub fn from_entry_id(key: CompactCacheKey, id: Option<CacheEntryId>) -> Self
pub fn from_entry_id(key: CompactCacheKey, id: Option<CacheEntryId>) -> Self
Construct an entry from its logical key and optional storage-defined identity.
Sourcepub fn key_only(key: CompactCacheKey) -> Self
pub fn key_only(key: CompactCacheKey) -> Self
Construct an entry identified only by its logical cache key.
Sourcepub fn identified(key: CompactCacheKey, id: CacheEntryId) -> Self
pub fn identified(key: CompactCacheKey, id: CacheEntryId) -> Self
Construct an entry with storage-defined identity.
Sourcepub fn key(&self) -> &CompactCacheKey
pub fn key(&self) -> &CompactCacheKey
Return the underlying cache key.
Sourcepub fn into_key(self) -> CompactCacheKey
pub fn into_key(self) -> CompactCacheKey
Consume the eviction key and return its 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 Clone for CacheEntryKey
impl Clone for CacheEntryKey
Source§fn clone(&self) -> CacheEntryKey
fn clone(&self) -> CacheEntryKey
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CacheEntryKey
impl Debug for CacheEntryKey
Source§impl Default for CacheEntryKey
impl Default for CacheEntryKey
Source§impl<'de> Deserialize<'de> for CacheEntryKey
impl<'de> Deserialize<'de> for CacheEntryKey
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>,
Source§impl Display for CacheEntryKey
impl Display for CacheEntryKey
impl Eq for CacheEntryKey
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
Source§impl Hash for CacheEntryKey
impl Hash for CacheEntryKey
Source§impl Ord for CacheEntryKey
impl Ord for CacheEntryKey
Source§fn cmp(&self, other: &CacheEntryKey) -> Ordering
fn cmp(&self, other: &CacheEntryKey) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for CacheEntryKey
impl PartialEq for CacheEntryKey
Source§impl PartialOrd for CacheEntryKey
impl PartialOrd for CacheEntryKey
Source§impl Serialize for CacheEntryKey
impl Serialize for CacheEntryKey
impl StructuralPartialEq for CacheEntryKey
Auto Trait Implementations§
impl Freeze for CacheEntryKey
impl RefUnwindSafe for CacheEntryKey
impl Send for CacheEntryKey
impl Sync for CacheEntryKey
impl Unpin for CacheEntryKey
impl UnsafeUnpin for CacheEntryKey
impl UnwindSafe for CacheEntryKey
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
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
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
key and return true if they are equal.