pub struct HeuristicCacheRef { /* private fields */ }Expand description
Shareable handle to the heuristic cache. Cheap to clone.
Implementations§
Source§impl HeuristicCacheRef
impl HeuristicCacheRef
pub fn with_capacity(capacity: usize) -> Self
pub fn default_size() -> Self
Sourcepub fn get(&self, key: &HeuristicKey) -> Option<HeuristicEntry>
pub fn get(&self, key: &HeuristicKey) -> Option<HeuristicEntry>
Cache hit (refreshes LRU order) or miss.
Sourcepub fn insert(&self, key: HeuristicKey, entry: HeuristicEntry)
pub fn insert(&self, key: HeuristicKey, entry: HeuristicEntry)
Insert a (key, entry) pair, possibly evicting the LRU tail.
pub fn is_empty(&self) -> bool
Trait Implementations§
Source§impl Clone for HeuristicCacheRef
impl Clone for HeuristicCacheRef
Source§fn clone(&self) -> HeuristicCacheRef
fn clone(&self) -> HeuristicCacheRef
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for HeuristicCacheRef
impl !RefUnwindSafe for HeuristicCacheRef
impl Send for HeuristicCacheRef
impl Sync for HeuristicCacheRef
impl Unpin for HeuristicCacheRef
impl UnsafeUnpin for HeuristicCacheRef
impl !UnwindSafe for HeuristicCacheRef
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