pub struct DualCacheFF<K, V, P, const CAP2: usize, const CAP1: usize, const CAP0: usize, const TOTAL_CAP: usize, const MAX_THREADS: usize, const TLS_CAP: usize, const TLS_INDEX_CAP: usize>{
pub daemon_mode: AtomicBool,
pub cata_mode: AtomicBool,
pub tls_registry: TlsRegistry<K, V, MAX_THREADS, TLS_CAP, TLS_INDEX_CAP>,
pub global_tx: RwLock<Option<Arc<BoundedQueue<DaemonMessage<K, V>, 65536>>>>,
pub daemon_handle: RwLock<Option<Daemon>>,
/* private fields */
}Expand description
DualCacheFF is the main entry point for the cache, providing standard API operations and managing the
background daemon for garbage collection and memory reclamation.
Fields§
§daemon_mode: AtomicBool§cata_mode: AtomicBool§tls_registry: TlsRegistry<K, V, MAX_THREADS, TLS_CAP, TLS_INDEX_CAP>§global_tx: RwLock<Option<Arc<BoundedQueue<DaemonMessage<K, V>, 65536>>>>§daemon_handle: RwLock<Option<Daemon>>Implementations§
Source§impl<K, V, P, const CAP2: usize, const CAP1: usize, const CAP0: usize, const TOTAL_CAP: usize, const MAX_THREADS: usize, const TLS_CAP: usize, const TLS_INDEX_CAP: usize> DualCacheFF<K, V, P, CAP2, CAP1, CAP0, TOTAL_CAP, MAX_THREADS, TLS_CAP, TLS_INDEX_CAP>
impl<K, V, P, const CAP2: usize, const CAP1: usize, const CAP0: usize, const TOTAL_CAP: usize, const MAX_THREADS: usize, const TLS_CAP: usize, const TLS_INDEX_CAP: usize> DualCacheFF<K, V, P, CAP2, CAP1, CAP0, TOTAL_CAP, MAX_THREADS, TLS_CAP, TLS_INDEX_CAP>
pub const fn new(eviction: P::Evict) -> Self
Sourcepub fn set_cata_tuning(&'static self, on: bool)
pub fn set_cata_tuning(&'static self, on: bool)
Start the CATA-DC Demiurge tuning engine in the background
Sourcepub fn set_daemon_mode(&'static self, on: bool)
pub fn set_daemon_mode(&'static self, on: bool)
Turn the Daemon on or off. If turned on, a new daemon thread is automatically spawned and channel is established.
Sourcepub fn register_thread(&self) -> TlsHandle
pub fn register_thread(&self) -> TlsHandle
Register the current thread to get a fast TLS handle.
pub fn get(&self, key: &K, handle: &TlsHandle) -> Option<V>
pub fn insert(&self, key: K, value: V, handle: &TlsHandle)
Source§impl<K, V, P, const CAP2: usize, const CAP1: usize, const CAP0: usize, const TOTAL_CAP: usize, const MAX_THREADS: usize, const TLS_CAP: usize, const TLS_INDEX_CAP: usize> DualCacheFF<K, V, P, CAP2, CAP1, CAP0, TOTAL_CAP, MAX_THREADS, TLS_CAP, TLS_INDEX_CAP>
impl<K, V, P, const CAP2: usize, const CAP1: usize, const CAP0: usize, const TOTAL_CAP: usize, const MAX_THREADS: usize, const TLS_CAP: usize, const TLS_INDEX_CAP: usize> DualCacheFF<K, V, P, CAP2, CAP1, CAP0, TOTAL_CAP, MAX_THREADS, TLS_CAP, TLS_INDEX_CAP>
pub fn get_metrics(&self) -> (u64, u64)
Trait Implementations§
Source§impl<K, V, P, const CAP2: usize, const CAP1: usize, const CAP0: usize, const TOTAL_CAP: usize, const MAX_THREADS: usize, const TLS_CAP: usize, const TLS_INDEX_CAP: usize> Default for DualCacheFF<K, V, P, CAP2, CAP1, CAP0, TOTAL_CAP, MAX_THREADS, TLS_CAP, TLS_INDEX_CAP>
Available on crate feature std only.
impl<K, V, P, const CAP2: usize, const CAP1: usize, const CAP0: usize, const TOTAL_CAP: usize, const MAX_THREADS: usize, const TLS_CAP: usize, const TLS_INDEX_CAP: usize> Default for DualCacheFF<K, V, P, CAP2, CAP1, CAP0, TOTAL_CAP, MAX_THREADS, TLS_CAP, TLS_INDEX_CAP>
Available on crate feature
std only.Source§impl<K, V, P, const T0_CAP: usize, const T1_CAP: usize, const T2_CAP: usize, const TOTAL_CAP: usize, const MAX_THREADS: usize, const TLS_CAP: usize, const TLS_INDEX_CAP: usize> Drop for DualCacheFF<K, V, P, T0_CAP, T1_CAP, T2_CAP, TOTAL_CAP, MAX_THREADS, TLS_CAP, TLS_INDEX_CAP>
Available on crate feature std only.
impl<K, V, P, const T0_CAP: usize, const T1_CAP: usize, const T2_CAP: usize, const TOTAL_CAP: usize, const MAX_THREADS: usize, const TLS_CAP: usize, const TLS_INDEX_CAP: usize> Drop for DualCacheFF<K, V, P, T0_CAP, T1_CAP, T2_CAP, TOTAL_CAP, MAX_THREADS, TLS_CAP, TLS_INDEX_CAP>
Available on crate feature
std only.impl<K, V, P, const CAP2: usize, const CAP1: usize, const CAP0: usize, const TOTAL_CAP: usize, const MAX_THREADS: usize, const TLS_CAP: usize, const TLS_INDEX_CAP: usize> Send for DualCacheFF<K, V, P, CAP2, CAP1, CAP0, TOTAL_CAP, MAX_THREADS, TLS_CAP, TLS_INDEX_CAP>
Available on crate feature
std only.impl<K, V, P, const CAP2: usize, const CAP1: usize, const CAP0: usize, const TOTAL_CAP: usize, const MAX_THREADS: usize, const TLS_CAP: usize, const TLS_INDEX_CAP: usize> Sync for DualCacheFF<K, V, P, CAP2, CAP1, CAP0, TOTAL_CAP, MAX_THREADS, TLS_CAP, TLS_INDEX_CAP>
Available on crate feature
std only.Auto Trait Implementations§
impl<K, V, P, const CAP2: usize, const CAP1: usize, const CAP0: usize, const TOTAL_CAP: usize, const MAX_THREADS: usize, const TLS_CAP: usize, const TLS_INDEX_CAP: usize> !Freeze for DualCacheFF<K, V, P, CAP2, CAP1, CAP0, TOTAL_CAP, MAX_THREADS, TLS_CAP, TLS_INDEX_CAP>
impl<K, V, P, const CAP2: usize, const CAP1: usize, const CAP0: usize, const TOTAL_CAP: usize, const MAX_THREADS: usize, const TLS_CAP: usize, const TLS_INDEX_CAP: usize> !RefUnwindSafe for DualCacheFF<K, V, P, CAP2, CAP1, CAP0, TOTAL_CAP, MAX_THREADS, TLS_CAP, TLS_INDEX_CAP>
impl<K, V, P, const CAP2: usize, const CAP1: usize, const CAP0: usize, const TOTAL_CAP: usize, const MAX_THREADS: usize, const TLS_CAP: usize, const TLS_INDEX_CAP: usize> !UnwindSafe for DualCacheFF<K, V, P, CAP2, CAP1, CAP0, TOTAL_CAP, MAX_THREADS, TLS_CAP, TLS_INDEX_CAP>
impl<K, V, P, const CAP2: usize, const CAP1: usize, const CAP0: usize, const TOTAL_CAP: usize, const MAX_THREADS: usize, const TLS_CAP: usize, const TLS_INDEX_CAP: usize> Unpin for DualCacheFF<K, V, P, CAP2, CAP1, CAP0, TOTAL_CAP, MAX_THREADS, TLS_CAP, TLS_INDEX_CAP>
impl<K, V, P, const CAP2: usize, const CAP1: usize, const CAP0: usize, const TOTAL_CAP: usize, const MAX_THREADS: usize, const TLS_CAP: usize, const TLS_INDEX_CAP: usize> UnsafeUnpin for DualCacheFF<K, V, P, CAP2, CAP1, CAP0, TOTAL_CAP, MAX_THREADS, TLS_CAP, TLS_INDEX_CAP>
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