Struct taskchampion::WorkingSet
source · 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.