[−][src]Struct rocks::cache::CacheBuilder
Methods
impl CacheBuilder
[src]
pub fn new_lru(capacity: usize) -> CacheBuilder
[src]
Create a new cache with a fixed size capacity. The cache is sharded to 2^num_shard_bits shards, by hash of the key. The total capacity is divided and evenly assigned to each shard. If strict_capacity_limit is set, insert to the cache will fail when cache is full. User can also set percentage of the cache reserves for high priority entries via high_pri_pool_pct. num_shard_bits = -1 means it is automatically determined: every shard will be at least 512KB and number of shard bits will not exceed 6.
pub fn new_clock(capacity: usize) -> CacheBuilder
[src]
Similar to NewLRUCache, but create a cache based on CLOCK algorithm with better concurrent performance in some cases. See util/clock_cache.cc for more detail.
Return nullptr if it is not supported.
pub fn build(&mut self) -> Option<Cache>
[src]
pub fn num_shard_bits(&mut self, bits: i32) -> &mut Self
[src]
pub fn strict_capacity_limit(&mut self, strict: bool) -> &mut Self
[src]
pub fn high_pri_pool_ratio(&mut self, ratio: f64) -> &mut Self
[src]
Auto Trait Implementations
impl RefUnwindSafe for CacheBuilder
impl Send for CacheBuilder
impl Sync for CacheBuilder
impl Unpin for CacheBuilder
impl UnwindSafe for CacheBuilder
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,