pub struct CacheState { /* private fields */ }Expand description
The client-side cache: response entries keyed by the full command, plus a reverse index from Redis key to the cache entries that depend on it.
This is an opaque handle. Construct one with CacheState::default to
share a cache between a CacheService
and its invalidation task; the cache is managed internally by those types.
Implementations§
Source§impl CacheState
impl CacheState
Sourcepub fn is_enabled(&self) -> bool
pub fn is_enabled(&self) -> bool
Whether caching is currently active (the tracking connection is healthy).
A false here means reads are passing through to the server.
Sourcepub fn statistics(&self) -> CacheStatistics
pub fn statistics(&self) -> CacheStatistics
Return a lock-free snapshot of the aggregate cache counters.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for CacheState
impl !RefUnwindSafe for CacheState
impl !UnwindSafe for CacheState
impl Send for CacheState
impl Sync for CacheState
impl Unpin for CacheState
impl UnsafeUnpin for CacheState
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