struct Partition<K: Eq + Hash, V> {
last_read: Instant,
next_expiry: Instant,
size: usize,
records: HashMap<K, Vec<(V, Instant)>>,
}
Expand description
The cached records for a domain.
Fields§
§last_read: Instant
The time this partition was last read at.
next_expiry: Instant
When the next record expires.
INVARIANT: this is the minimum of the expiry times of the records
.
size: usize
How many records there are.
INVARIANT: this is the sum of the vector lengths in records
.
records: HashMap<K, Vec<(V, Instant)>>
The records, further divided by record key.
Trait Implementations§
impl<K: Eq + Eq + Hash, V: Eq> Eq for Partition<K, V>
impl<K: Eq + Hash, V> StructuralPartialEq for Partition<K, V>
Auto Trait Implementations§
impl<K, V> Freeze for Partition<K, V>
impl<K, V> RefUnwindSafe for Partition<K, V>where
K: RefUnwindSafe,
V: RefUnwindSafe,
impl<K, V> Send for Partition<K, V>
impl<K, V> Sync for Partition<K, V>
impl<K, V> Unpin for Partition<K, V>
impl<K, V> UnwindSafe for Partition<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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.