pub struct HybridCacheStorageWriter<K, V, S = DefaultHasher>{ /* private fields */ }Expand description
Writer for disk cache of a hybrid cache to support more flexible write APIs.
Implementations§
Source§impl<K, V, S> HybridCacheStorageWriter<K, V, S>
impl<K, V, S> HybridCacheStorageWriter<K, V, S>
Sourcepub fn filter(&mut self, estimated_size: usize) -> StorageFilterResult
pub fn filter(&mut self, estimated_size: usize) -> StorageFilterResult
Check if the entry can be admitted by the admission filter of the disk cache.
The estimated_size is the estimated size of the whole entry to be inserted.
After calling filter, the writer will not be checked by the admission filter again.
Sourcepub fn force(self) -> Self
pub fn force(self) -> Self
Force the disk cache to admit the writer.
Note: There is still chance that the entry is ignored because of the storage engine buffer full.
Sourcepub fn insert(self, value: V) -> Option<HybridCacheEntry<K, V, S>>
pub fn insert(self, value: V) -> Option<HybridCacheEntry<K, V, S>>
Insert the entry to the disk cache only.
Sourcepub fn insert_with_properties(
self,
value: V,
properties: HybridCacheProperties,
) -> Option<HybridCacheEntry<K, V, S>>
pub fn insert_with_properties( self, value: V, properties: HybridCacheProperties, ) -> Option<HybridCacheEntry<K, V, S>>
Insert the entry with properties to the disk cache only.
Auto Trait Implementations§
impl<K, V, S = BuildHasherDefault<Hasher>> !RefUnwindSafe for HybridCacheStorageWriter<K, V, S>
impl<K, V, S = BuildHasherDefault<Hasher>> !UnwindSafe for HybridCacheStorageWriter<K, V, S>
impl<K, V, S> Freeze for HybridCacheStorageWriter<K, V, S>
impl<K, V, S> Send for HybridCacheStorageWriter<K, V, S>where
HybridCache<K, V, S>: Send,
impl<K, V, S> Sync for HybridCacheStorageWriter<K, V, S>where
HybridCache<K, V, S>: Sync,
impl<K, V, S> Unpin for HybridCacheStorageWriter<K, V, S>
impl<K, V, S> UnsafeUnpin for HybridCacheStorageWriter<K, V, S>
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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