pub struct UnboundedLinearCache<K, V>where
K: ApproxComparable,
V: Clone,{ /* private fields */ }Expand description
A cache implementation that checks all entries one-by-one, without eviction
§Generic Types
The types K and V are used for the cache keys and values respectively.
K should be ApproxComparable, i.e. the compiler should know how to
decide that two K’s are ‘close enough’ given a certain tolerance.
V should be Clone so that the user can do whatever they want with a returned
value without messing with the actual cache line.
§Constructors
Use the from method to create a new cache. You will be asked to provide a
tolerance for the search and (optionally) an initial allocated capacity in memory.
tolerance indicates the searching sensitivity (see ApproxComparable),
which is a constant w.r.t. to the queried K (for now).
Implementations§
Source§impl<K, V> UnboundedLinearCache<K, V>where
K: ApproxComparable,
V: Clone,
impl<K, V> UnboundedLinearCache<K, V>where
K: ApproxComparable,
V: Clone,
Trait Implementations§
Auto Trait Implementations§
impl<K, V> Freeze for UnboundedLinearCache<K, V>
impl<K, V> RefUnwindSafe for UnboundedLinearCache<K, V>where
K: RefUnwindSafe,
V: RefUnwindSafe,
impl<K, V> Send for UnboundedLinearCache<K, V>
impl<K, V> Sync for UnboundedLinearCache<K, V>
impl<K, V> Unpin for UnboundedLinearCache<K, V>
impl<K, V> UnwindSafe for UnboundedLinearCache<K, V>where
K: UnwindSafe,
V: UnwindSafe,
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