pub struct WorkingSet { /* private fields */ }
Expand description
A WorkingSet represents a snapshot of the working set from a replica.
A replica’s working set is a mapping from small integers to task uuids for all pending tasks. The small integers are meant to be stable, easily-typed identifiers for users to interact with important tasks.
IMPORTANT: the content of the working set may change at any time that a DB transaction is not in progress, and the data in this type will not be updated automatically. It is up to the caller to decide how long to keep this value, and how much to trust the accuracy of its contents. In practice, the answers are usually “a few milliseconds” and treating unexpected results as non-fatal.
Implementations§
Source§impl WorkingSet
impl WorkingSet
Sourcepub fn len(&self) -> usize
pub fn len(&self) -> usize
Get the “length” of the working set: the total number of uuids in the set.
Sourcepub fn largest_index(&self) -> usize
pub fn largest_index(&self) -> usize
Get the largest index in the working set, or zero if the set is empty.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for WorkingSet
impl RefUnwindSafe for WorkingSet
impl Send for WorkingSet
impl Sync for WorkingSet
impl Unpin for WorkingSet
impl UnwindSafe for WorkingSet
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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>
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 more