[][src]Struct rocks::cache::Cache

pub struct Cache { /* fields omitted */ }

A builtin cache implementation with a least-recently-used eviction policy is provided. Clients may use their own implementations if they want something more sophisticated (like scan-resistance, a custom eviction policy, variable cache sizing, etc.)

Implementations

impl Cache[src]

pub fn name(&self) -> &str[src]

The type of the Cache

pub fn set_capacity(&mut self, capacity: usize)[src]

sets the maximum configured capacity of the cache. When the new capacity is less than the old capacity and the existing usage is greater than new capacity, the implementation will do its best job to purge the released entries from the cache in order to lower the usage

pub fn get_capacity(&self) -> usize[src]

returns the maximum configured capacity of the cache

pub fn get_usage(&self) -> usize[src]

returns the memory size for a specific entry in the cache.

Trait Implementations

impl Drop for Cache[src]

Auto Trait Implementations

impl RefUnwindSafe for Cache

impl !Send for Cache

impl !Sync for Cache

impl Unpin for Cache

impl UnwindSafe for Cache

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.