Struct tlspuffin::tls::rustls::limited_cache::LimitedCache
source · pub struct LimitedCache<K: Clone + Hash + Eq, V> {
map: HashMap<K, V>,
oldest: VecDeque<K>,
}
Expand description
A HashMap-alike, which never gets larger than a specified capacity, and evicts the oldest insertion to maintain this.
The requested capacity may be rounded up by the underlying collections. This implementation uses all the allocated storage.
This is inefficient: it stores keys twice.
Fields§
§map: HashMap<K, V>
§oldest: VecDeque<K>
Implementations§
Auto Trait Implementations§
impl<K, V> Freeze for LimitedCache<K, V>
impl<K, V> RefUnwindSafe for LimitedCache<K, V>where
K: RefUnwindSafe,
V: RefUnwindSafe,
impl<K, V> Send for LimitedCache<K, V>
impl<K, V> Sync for LimitedCache<K, V>
impl<K, V> Unpin for LimitedCache<K, V>
impl<K, V> UnwindSafe for LimitedCache<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
§impl<Tail, T> Prepend<T> for Tail
impl<Tail, T> Prepend<T> for Tail
§type PreprendResult = Tail
type PreprendResult = Tail
The Resulting [
TupleList
], of an [Prepend::prepend()
] call,
including the prepended entry.