Struct foyer::HybridCacheBuilder
source · pub struct HybridCacheBuilder<K, V> { /* private fields */ }Expand description
Hybrid cache builder.
Implementations§
source§impl<K, V> HybridCacheBuilder<K, V>
impl<K, V> HybridCacheBuilder<K, V>
sourcepub fn with_name(self, name: &str) -> Self
pub fn with_name(self, name: &str) -> Self
Set the name of the foyer hybrid cache instance.
Foyer will use the name as the prefix of the metric names.
Default: foyer.
sourcepub fn with_event_listener(
self,
event_listener: Arc<dyn EventListener<Key = K, Value = V>>,
) -> Self
pub fn with_event_listener( self, event_listener: Arc<dyn EventListener<Key = K, Value = V>>, ) -> Self
Set event listener.
Default: No event listener installed.
sourcepub fn with_tracing_config(self, tracing_config: TracingConfig) -> Self
pub fn with_tracing_config(self, tracing_config: TracingConfig) -> Self
Set tracing config.
Default: Only operations over 1s will be recorded.
sourcepub fn memory(
self,
capacity: usize,
) -> HybridCacheBuilderPhaseMemory<K, V, RandomState>where
K: StorageKey,
V: StorageValue,
pub fn memory(
self,
capacity: usize,
) -> HybridCacheBuilderPhaseMemory<K, V, RandomState>where
K: StorageKey,
V: StorageValue,
Continue to modify the in-memory cache configurations.
Trait Implementations§
Auto Trait Implementations§
impl<K, V> !Freeze for HybridCacheBuilder<K, V>
impl<K, V> !RefUnwindSafe for HybridCacheBuilder<K, V>
impl<K, V> Send for HybridCacheBuilder<K, V>
impl<K, V> Sync for HybridCacheBuilder<K, V>
impl<K, V> Unpin for HybridCacheBuilder<K, V>
impl<K, V> !UnwindSafe for HybridCacheBuilder<K, V>
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