pub struct MemoryCache { /* private fields */ }Implementations§
Source§impl MemoryCache
impl MemoryCache
pub fn new() -> MemoryCache
pub fn holding(max_bytes: u64) -> MemoryCache
Trait Implementations§
Source§impl Cache for MemoryCache
impl Cache for MemoryCache
Source§fn worth_storing(
&self,
_cost: Duration,
_bytes: usize,
_kind: PayloadKind,
) -> bool
fn worth_storing( &self, _cost: Duration, _bytes: usize, _kind: PayloadKind, ) -> bool
A hit is a memcpy, so anything computed is kept until the budget says otherwise.
fn max_bytes(&self) -> u64
fn held_bytes(&self) -> u64
fn evicted_bytes(&self) -> u64
fn holds(&self, key: Hash) -> bool
fn load(&self, key: Hash, node: &str, expected: Expected) -> Option<Entry>
fn store( &self, key: Hash, payload: &Payload, traces: &[FilterTrace], label: Option<&Label>, )
fn faults(&self) -> u64
fn dir(&self) -> Option<&Path>
Source§impl Default for MemoryCache
impl Default for MemoryCache
Source§fn default() -> MemoryCache
fn default() -> MemoryCache
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !Freeze for MemoryCache
impl RefUnwindSafe for MemoryCache
impl Send for MemoryCache
impl Sync for MemoryCache
impl Unpin for MemoryCache
impl UnsafeUnpin for MemoryCache
impl UnwindSafe for MemoryCache
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