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.
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.
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 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