pub struct InMemoryCacheBuilder<CacheModels: CacheableModels = DefaultCacheModels>(/* private fields */);
Expand description
Builder to configure and construct an InMemoryCache
.
Implementations§
Source§impl<CacheModels: CacheableModels> InMemoryCacheBuilder<CacheModels>
impl<CacheModels: CacheableModels> InMemoryCacheBuilder<CacheModels>
Sourcepub const fn new() -> Self
pub const fn new() -> Self
Creates a builder to configure and construct an InMemoryCache
.
Sourcepub fn build(self) -> InMemoryCache<CacheModels>
pub fn build(self) -> InMemoryCache<CacheModels>
Consume the builder, returning a configured cache.
Sourcepub const fn resource_types(self, resource_types: ResourceType) -> Self
pub const fn resource_types(self, resource_types: ResourceType) -> Self
Sets the list of resource types for the cache to handle.
Defaults to all types.
Sourcepub const fn message_cache_size(self, message_cache_size: usize) -> Self
pub const fn message_cache_size(self, message_cache_size: usize) -> Self
Sets the number of messages to cache per channel.
Defaults to 100.
Trait Implementations§
Source§impl<CacheModels: Debug + CacheableModels> Debug for InMemoryCacheBuilder<CacheModels>
impl<CacheModels: Debug + CacheableModels> Debug for InMemoryCacheBuilder<CacheModels>
Source§impl<CacheModels: CacheableModels> Default for InMemoryCacheBuilder<CacheModels>
impl<CacheModels: CacheableModels> Default for InMemoryCacheBuilder<CacheModels>
Auto Trait Implementations§
impl<CacheModels> Freeze for InMemoryCacheBuilder<CacheModels>
impl<CacheModels> RefUnwindSafe for InMemoryCacheBuilder<CacheModels>where
CacheModels: RefUnwindSafe,
impl<CacheModels> Send for InMemoryCacheBuilder<CacheModels>where
CacheModels: Send,
impl<CacheModels> Sync for InMemoryCacheBuilder<CacheModels>where
CacheModels: Sync,
impl<CacheModels> Unpin for InMemoryCacheBuilder<CacheModels>where
CacheModels: Unpin,
impl<CacheModels> UnwindSafe for InMemoryCacheBuilder<CacheModels>where
CacheModels: UnwindSafe,
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