pub struct CacheTier<K, V, P: EvictionPolicy = DefaultEvictionPolicy, const CAPACITY: usize = 0, const WAYS: usize = 8> { /* private fields */ }Expand description
Represents a single cache tier (e.g., T0, T1, T2) using Set-Associative Lock-Free arrays.
Implementations§
Source§impl<K, V, P: EvictionPolicy, const CAPACITY: usize, const WAYS: usize> CacheTier<K, V, P, CAPACITY, WAYS>
impl<K, V, P: EvictionPolicy, const CAPACITY: usize, const WAYS: usize> CacheTier<K, V, P, CAPACITY, WAYS>
Sourcepub fn get_set(&self, hash: usize) -> &[Slot<K, V>]
pub fn get_set(&self, hash: usize) -> &[Slot<K, V>]
Retrieve the set of slots for a given hash.
Sourcepub fn fetch_hint<const N: usize>(
&self,
hash: usize,
arena: &Arena<K, V, N>,
guard: &Guard,
) -> Option<(K, V)>
pub fn fetch_hint<const N: usize>( &self, hash: usize, arena: &Arena<K, V, N>, guard: &Guard, ) -> Option<(K, V)>
Touch a slot by hash to prevent it from being evicted (Prefetch hint)
Trait Implementations§
Auto Trait Implementations§
impl<K, V, P = DefaultEvictionPolicy, const CAPACITY: usize = 0, const WAYS: usize = 8> !Freeze for CacheTier<K, V, P, CAPACITY, WAYS>
impl<K, V, P, const CAPACITY: usize, const WAYS: usize> RefUnwindSafe for CacheTier<K, V, P, CAPACITY, WAYS>
impl<K, V, P, const CAPACITY: usize, const WAYS: usize> Send for CacheTier<K, V, P, CAPACITY, WAYS>
impl<K, V, P, const CAPACITY: usize, const WAYS: usize> Sync for CacheTier<K, V, P, CAPACITY, WAYS>
impl<K, V, P, const CAPACITY: usize, const WAYS: usize> Unpin for CacheTier<K, V, P, CAPACITY, WAYS>
impl<K, V, P, const CAPACITY: usize, const WAYS: usize> UnsafeUnpin for CacheTier<K, V, P, CAPACITY, WAYS>where
P: UnsafeUnpin,
impl<K, V, P, const CAPACITY: usize, const WAYS: usize> UnwindSafe for CacheTier<K, V, P, CAPACITY, WAYS>
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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