pub struct StoreBuilder<K, V, S, P>{ /* private fields */ }Expand description
The builder of the disk cache.
Implementations§
Source§impl<K, V, S, P> StoreBuilder<K, V, S, P>
impl<K, V, S, P> StoreBuilder<K, V, S, P>
Sourcepub fn new(
name: impl Into<Cow<'static, str>>,
memory: Cache<K, V, S, P>,
metrics: Arc<Metrics>,
) -> Self
pub fn new( name: impl Into<Cow<'static, str>>, memory: Cache<K, V, S, P>, metrics: Arc<Metrics>, ) -> Self
Setup disk cache store for the given in-memory cache.
Sourcepub fn with_io_engine_config(
self,
io_engine_builder: impl Into<Box<dyn IoEngineConfig>>,
) -> Self
pub fn with_io_engine_config( self, io_engine_builder: impl Into<Box<dyn IoEngineConfig>>, ) -> Self
Set io engine config for the disk cache store.
Sourcepub fn with_engine_config(
self,
config: impl Into<Box<dyn EngineConfig<K, V, P>>>,
) -> Self
pub fn with_engine_config( self, config: impl Into<Box<dyn EngineConfig<K, V, P>>>, ) -> Self
Set engine config for the disk cache store.
Sourcepub fn with_compression(self, compression: Compression) -> Self
pub fn with_compression(self, compression: Compression) -> Self
Set the compression algorithm of the disk cache store.
Default: Compression::None.
Sourcepub fn with_recover_mode(self, recover_mode: RecoverMode) -> Self
pub fn with_recover_mode(self, recover_mode: RecoverMode) -> Self
Set the recover mode for the disk cache store.
See more in RecoverMode.
Default: RecoverMode::Quiet.
Sourcepub fn with_spawner(self, spawner: Spawner) -> Self
pub fn with_spawner(self, spawner: Spawner) -> Self
Configure the task spawner for the disk cache store.
By default, it will use the current spawner that built foyer.
For example, with tokio, it will be tokio::runtime::Handle::current().
FYI: Spawner and Spawner::current()
Trait Implementations§
Source§impl<K, V, S, P> Debug for StoreBuilder<K, V, S, P>
impl<K, V, S, P> Debug for StoreBuilder<K, V, S, P>
Auto Trait Implementations§
impl<K, V, S, P> Freeze for StoreBuilder<K, V, S, P>
impl<K, V, S, P> !RefUnwindSafe for StoreBuilder<K, V, S, P>
impl<K, V, S, P> Send for StoreBuilder<K, V, S, P>
impl<K, V, S, P> Sync for StoreBuilder<K, V, S, P>
impl<K, V, S, P> Unpin for StoreBuilder<K, V, S, P>
impl<K, V, S, P> !UnwindSafe for StoreBuilder<K, V, S, P>
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