pub struct BlockCacheLifecycle;Expand description
Lifecycle hooks for the block cache that prevent eviction of entries
still referenced outside the cache (i.e., with Arc strong count > 1).
Trait Implementations§
Source§impl Clone for BlockCacheLifecycle
impl Clone for BlockCacheLifecycle
Source§fn clone(&self) -> BlockCacheLifecycle
fn clone(&self) -> BlockCacheLifecycle
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Default for BlockCacheLifecycle
impl Default for BlockCacheLifecycle
Source§fn default() -> BlockCacheLifecycle
fn default() -> BlockCacheLifecycle
Returns the “default value” for a type. Read more
Source§impl Lifecycle<(u32, u16), ArcBytes> for BlockCacheLifecycle
impl Lifecycle<(u32, u16), ArcBytes> for BlockCacheLifecycle
type RequestState = ()
Source§fn is_pinned(&self, _key: &(u32, u16), val: &ArcBytes) -> bool
fn is_pinned(&self, _key: &(u32, u16), val: &ArcBytes) -> bool
Returns whether the item is pinned. Items that are pinned can’t be evicted.
Note that a pinned item can still be replaced with get_mut, insert, replace and similar APIs. Read more
Source§fn begin_request(&self) -> Self::RequestState
fn begin_request(&self) -> Self::RequestState
Called before the insert request starts, e.g.: insert, replace.
Source§fn on_evict(
&self,
_state: &mut Self::RequestState,
_key: (u32, u16),
_val: ArcBytes,
)
fn on_evict( &self, _state: &mut Self::RequestState, _key: (u32, u16), _val: ArcBytes, )
Called when an item is evicted.
§fn before_evict(&self, state: &mut Self::RequestState, key: &Key, val: &mut Val)
fn before_evict(&self, state: &mut Self::RequestState, key: &Key, val: &mut Val)
Called when a cache item is about to be evicted.
Note that value replacement (e.g. insertions for the same key) won’t call this method. Read more
§fn end_request(&self, state: Self::RequestState)
fn end_request(&self, state: Self::RequestState)
Called after a request finishes, e.g.: insert, replace. Read more
Auto Trait Implementations§
impl Freeze for BlockCacheLifecycle
impl RefUnwindSafe for BlockCacheLifecycle
impl Send for BlockCacheLifecycle
impl Sync for BlockCacheLifecycle
impl Unpin for BlockCacheLifecycle
impl UnsafeUnpin for BlockCacheLifecycle
impl UnwindSafe for BlockCacheLifecycle
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more