pub struct LRUCache<V, ID: Hash> {
pub users: FxHashMap<ID, SmallVec<[u64; 2]>>,
/* private fields */
}Fields§
§users: FxHashMap<ID, SmallVec<[u64; 2]>>Implementations§
Source§impl<V, ID: Hash + Eq> LRUCache<V, ID>
impl<V, ID: Hash + Eq> LRUCache<V, ID>
pub fn get<H: Hash>(&self, hash_value: &H) -> Option<Rc<V>>
pub fn utilize<H: Hash>(&mut self, id: ID, hash_value: &H) -> Option<Rc<V>>
pub fn insert<H: Hash>(&mut self, id: ID, hash_value: &H, value: V) -> Rc<V>
pub fn remove(&mut self, id: &ID)
pub fn reset(&mut self)
pub fn print_metrics(&self)
Trait Implementations§
Auto Trait Implementations§
impl<V, ID> Freeze for LRUCache<V, ID>
impl<V, ID> RefUnwindSafe for LRUCache<V, ID>where
ID: RefUnwindSafe,
V: RefUnwindSafe,
impl<V, ID> !Send for LRUCache<V, ID>
impl<V, ID> !Sync for LRUCache<V, ID>
impl<V, ID> Unpin for LRUCache<V, ID>where
ID: Unpin,
impl<V, ID> UnwindSafe for LRUCache<V, ID>where
ID: UnwindSafe,
V: RefUnwindSafe,
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more