pub struct LruCacheOptions { /* private fields */ }
Implementations§
Source§impl LruCacheOptions
impl LruCacheOptions
Sourcepub fn set_capacity(&mut self, cap: usize)
pub fn set_capacity(&mut self, cap: usize)
Capacity of the cache, in the same units as the charge
of each entry.
This is typically measured in bytes, but can be a different unit if using
kDontChargeCacheMetadata.
Sourcepub fn set_num_shard_bits(&mut self, val: c_int)
pub fn set_num_shard_bits(&mut self, val: c_int)
Cache is sharded into 2^num_shard_bits shards, by hash of key. If < 0, a good default is chosen based on the capacity and the implementation. (Mutex-based implementations are much more reliant on many shards for parallel scalability.)
Trait Implementations§
Source§impl Default for LruCacheOptions
impl Default for LruCacheOptions
Source§impl Drop for LruCacheOptions
impl Drop for LruCacheOptions
impl Send for LruCacheOptions
impl Sync for LruCacheOptions
Auto Trait Implementations§
impl Freeze for LruCacheOptions
impl RefUnwindSafe for LruCacheOptions
impl Unpin for LruCacheOptions
impl UnwindSafe for LruCacheOptions
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