pub struct MaterializedKeys<K>{ /* private fields */ }Expand description
Tracks which keys are materialized (and which are pending an upquery).
Implementations§
Source§impl<K> MaterializedKeys<K>
impl<K> MaterializedKeys<K>
Sourcepub fn status(&self, key: &K) -> KeyStatus
pub fn status(&self, key: &K) -> KeyStatus
Reports a key’s status without mutating the tracker.
Sourcepub fn lookup(&mut self, key: K) -> LookupOutcome<K>
pub fn lookup(&mut self, key: K) -> LookupOutcome<K>
Probes the tracker for key. Missing keys are transitioned to pending and
an Upquery outcome is returned so the caller can dispatch the upquery.
Sourcepub fn mark_materialized(&mut self, key: K) -> usize
pub fn mark_materialized(&mut self, key: K) -> usize
Marks key as fully materialized. Returns the number of waiters that
had been blocked on the upquery (so callers can wake them).
Sourcepub fn mark_many_materialized<I>(&mut self, keys: I) -> usizewhere
I: IntoIterator<Item = K>,
pub fn mark_many_materialized<I>(&mut self, keys: I) -> usizewhere
I: IntoIterator<Item = K>,
Bulk-marks several keys as materialized; returns total waiter count.
Sourcepub fn forget(&mut self, key: &K) -> bool
pub fn forget(&mut self, key: &K) -> bool
Drops key from the materialized set (for example, after eviction).
Sourcepub fn fail_pending(&mut self, key: &K) -> usize
pub fn fail_pending(&mut self, key: &K) -> usize
Aborts a pending upquery for key, transitioning it back to Missing.
Sourcepub const fn materialized(&self) -> &BTreeSet<K>
pub const fn materialized(&self) -> &BTreeSet<K>
Returns the materialized key set.
Sourcepub fn materialized_len(&self) -> usize
pub fn materialized_len(&self) -> usize
Returns the number of materialized keys.
Sourcepub fn pending_len(&self) -> usize
pub fn pending_len(&self) -> usize
Returns the number of pending keys.
Source§impl<K> MaterializedKeys<K>
impl<K> MaterializedKeys<K>
Sourcepub fn lookup_batch<I>(&mut self, keys: I) -> BatchLookup<K>where
I: IntoIterator<Item = K>,
pub fn lookup_batch<I>(&mut self, keys: I) -> BatchLookup<K>where
I: IntoIterator<Item = K>,
Probes a batch of keys, splitting them into hit / upquery / pending sets.
Trait Implementations§
Source§impl<K> Clone for MaterializedKeys<K>
impl<K> Clone for MaterializedKeys<K>
Source§fn clone(&self) -> MaterializedKeys<K>
fn clone(&self) -> MaterializedKeys<K>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<K> Debug for MaterializedKeys<K>
impl<K> Debug for MaterializedKeys<K>
Source§impl<K> Default for MaterializedKeys<K>
impl<K> Default for MaterializedKeys<K>
impl<K> Eq for MaterializedKeys<K>
Source§impl<K> PartialEq for MaterializedKeys<K>
impl<K> PartialEq for MaterializedKeys<K>
Source§fn eq(&self, other: &MaterializedKeys<K>) -> bool
fn eq(&self, other: &MaterializedKeys<K>) -> bool
self and other values to be equal, and is used by ==.impl<K> StructuralPartialEq for MaterializedKeys<K>
Auto Trait Implementations§
impl<K> Freeze for MaterializedKeys<K>
impl<K> RefUnwindSafe for MaterializedKeys<K>where
K: RefUnwindSafe,
impl<K> Send for MaterializedKeys<K>where
K: Send,
impl<K> Sync for MaterializedKeys<K>where
K: Sync,
impl<K> Unpin for MaterializedKeys<K>
impl<K> UnsafeUnpin for MaterializedKeys<K>
impl<K> UnwindSafe for MaterializedKeys<K>where
K: 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> Data for Twhere
T: Clone + 'static,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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>
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>
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 moreSource§impl<'a, S, T> Semigroup<&'a S> for Twhere
T: Semigroup<S>,
impl<'a, S, T> Semigroup<&'a S> for Twhere
T: Semigroup<S>,
Source§fn plus_equals(&mut self, rhs: &&'a S)
fn plus_equals(&mut self, rhs: &&'a S)
std::ops::AddAssign, for types that do not implement AddAssign.