pub struct CacheBuilder<K, V, C> { /* private fields */ }Expand description
Implementations§
Source§impl<K, V> CacheBuilder<K, V, Cache<K, V, RandomState>>
impl<K, V> CacheBuilder<K, V, Cache<K, V, RandomState>>
Sourcepub fn new(max_capacity: u64) -> Self
pub fn new(max_capacity: u64) -> Self
Construct a new CacheBuilder that will be used to build a Cache holding
up to max_capacity entries.
Sourcepub fn build(self) -> Cache<K, V, RandomState>
pub fn build(self) -> Cache<K, V, RandomState>
Builds a Cache<K, V>.
Sourcepub fn build_with_hasher<S>(self, hasher: S) -> Cache<K, V, S>where
S: BuildHasher + Clone,
pub fn build_with_hasher<S>(self, hasher: S) -> Cache<K, V, S>where
S: BuildHasher + Clone,
Builds a Cache<K, V, S>, with the given hasher.
Source§impl<K, V, C> CacheBuilder<K, V, C>
impl<K, V, C> CacheBuilder<K, V, C>
Sourcepub fn max_capacity(self, max_capacity: u64) -> Self
pub fn max_capacity(self, max_capacity: u64) -> Self
Sets the max capacity of the cache.
Sourcepub fn initial_capacity(self, number_of_entries: usize) -> Self
pub fn initial_capacity(self, number_of_entries: usize) -> Self
Sets the initial capacity (number of entries) of the cache.
Trait Implementations§
Auto Trait Implementations§
impl<K, V, C> Freeze for CacheBuilder<K, V, C>
impl<K, V, C> RefUnwindSafe for CacheBuilder<K, V, C>
impl<K, V, C> Send for CacheBuilder<K, V, C>
impl<K, V, C> Sync for CacheBuilder<K, V, C>
impl<K, V, C> Unpin for CacheBuilder<K, V, C>
impl<K, V, C> UnwindSafe for CacheBuilder<K, V, C>
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