[−][src]Struct rocks::cache::Cache
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
Auto Trait Implementations
impl RefUnwindSafe for Cache
[src]
impl !Send for Cache
[src]
impl !Sync for Cache
[src]
impl Unpin for Cache
[src]
impl UnwindSafe for Cache
[src]
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,
pub 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.
pub 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>,