pub struct CacheManagerBuilder { /* private fields */ }Expand description
Builder for creating cache managers with different configurations.
Implementations§
Source§impl CacheManagerBuilder
impl CacheManagerBuilder
Sourcepub fn default_options(self, options: CacheOptions) -> Self
pub fn default_options(self, options: CacheOptions) -> Self
Set default cache options.
Sourcepub fn memory(self, config: MemoryCacheConfig) -> CacheManager<MemoryCache>
pub fn memory(self, config: MemoryCacheConfig) -> CacheManager<MemoryCache>
Build a cache manager with an in-memory backend.
Sourcepub async fn redis(
self,
config: RedisCacheConfig,
) -> CacheResult<CacheManager<RedisCache>>
pub async fn redis( self, config: RedisCacheConfig, ) -> CacheResult<CacheManager<RedisCache>>
Build a cache manager with a Redis backend.
Not yet implemented: the Redis backend has no client compiled in,
so this currently always returns Err(CacheError::Backend).
Sourcepub async fn tiered(
self,
memory_config: MemoryCacheConfig,
redis_config: RedisCacheConfig,
) -> CacheResult<CacheManager<TieredCache<MemoryCache, RedisCache>>>
pub async fn tiered( self, memory_config: MemoryCacheConfig, redis_config: RedisCacheConfig, ) -> CacheResult<CacheManager<TieredCache<MemoryCache, RedisCache>>>
Build a cache manager with a tiered backend.
Not yet usable with Redis L2: this constructs a RedisCache,
which is not yet implemented, so this currently always returns
Err(CacheError::Backend). For a working tiered setup, compose two
implemented backends with TieredCache::new directly.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CacheManagerBuilder
impl RefUnwindSafe for CacheManagerBuilder
impl Send for CacheManagerBuilder
impl Sync for CacheManagerBuilder
impl Unpin for CacheManagerBuilder
impl UnsafeUnpin for CacheManagerBuilder
impl UnwindSafe for CacheManagerBuilder
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