pub struct TimeSnapshot { /* private fields */ }Expand description
One read-only index of current entries and retained time History (T014).
Implementations§
Source§impl TimeSnapshot
impl TimeSnapshot
Sourcepub fn of(issues: &[Issue]) -> Self
pub fn of(issues: &[Issue]) -> Self
Index the current entries and time History of the issues a caller holds (T014).
One pass over the slice: each entry is resolved once (including the identity it is attributed to, which every later grouping and comparison reuses), and each issue’s time events are read once. Entries come out in data-model §6 order, so the same issues always produce the same bytes — which is what makes CLI, TUI, MCP and portable output agree on them (NFR-003).
Sourcepub fn entries(&self) -> &[IndexedEntry]
pub fn entries(&self) -> &[IndexedEntry]
Every indexed entry, in the snapshot’s deterministic order.
Sourcepub fn holds_issue(&self, number: u32) -> bool
pub fn holds_issue(&self, number: u32) -> bool
Whether the snapshot holds this issue — with or without entries.
Sourcepub fn deletions_on(&self, issue: u32) -> &[TimeDeletion]
pub fn deletions_on(&self, issue: u32) -> &[TimeDeletion]
The prior values deletions left in one issue’s History, in History order.
Sourcepub fn corrections_on(&self, issue: u32) -> usize
pub fn corrections_on(&self, issue: u32) -> usize
How many corrections one issue’s History retains.
Sourcepub fn total(&self, filter: &TimeFilter) -> TimeTotal
pub fn total(&self, filter: &TimeFilter) -> TimeTotal
The typed total for one scope (T015).
A refused filter yields one total whose state is
TimeTotalState::InvalidFilter and whose findings are the refusals — no
entry is evaluated, so an invalid bound can never be read as “no bound”. A
selector naming an issue this snapshot does not hold yields
TimeTotalState::UnknownIssue for the same reason.
Sourcepub fn totals(&self, filters: &[TimeFilter]) -> Vec<TimeTotal>
pub fn totals(&self, filters: &[TimeFilter]) -> Vec<TimeTotal>
Every requested scope, evaluated against this one snapshot (T014).
The filters are answered in the order they were given and each is derived from the same index, so a set of scopes costs no second scan, no second read and no second opinion.
Sourcepub fn by_issue(&self, filter: &TimeFilter) -> Vec<TimeTotal>
pub fn by_issue(&self, filter: &TimeFilter) -> Vec<TimeTotal>
One total per issue the snapshot holds (T014, FR-003).
Every issue appears, including an issue holding no entry — its total is
TimeTotalState::Nothing with zero counts, which is a real answer and not
an absence to hide. An entry whose date falls outside a period is still this
issue’s entry, so a period-bounded breakdown keeps the issue and reports
nothing inside the period, rather than making the issue vanish.
Sourcepub fn by_assignee(&self, filter: &TimeFilter) -> Vec<TimeTotal>
pub fn by_assignee(&self, filter: &TimeFilter) -> Vec<TimeTotal>
One total per identity that did work in scope (T014, FR-003).
ada and @Ada are one identity, through the identity model the rest of the
crate uses; an entry whose author names no identity is shown under
TimeGroup::Unattributed rather than dropped.
Sourcepub fn by_date(&self, filter: &TimeFilter) -> Vec<TimeTotal>
pub fn by_date(&self, filter: &TimeFilter) -> Vec<TimeTotal>
One total per calendar date in scope (T014, FR-003).
A date outside a period gets no group at all — a group whose key is a date
the period excludes would contradict itself — while an entry the period cannot
place (no date, or a date the validator refuses) is shown under
TimeGroup::Undated and counted, so the breakdown never hides it.
Sourcepub fn audit(&self, filter: &TimeFilter) -> TimeAudit
pub fn audit(&self, filter: &TimeFilter) -> TimeAudit
The explicit audit view for one scope (T017).
Trait Implementations§
Source§impl Clone for TimeSnapshot
impl Clone for TimeSnapshot
Source§impl Debug for TimeSnapshot
impl Debug for TimeSnapshot
Source§impl Default for TimeSnapshot
impl Default for TimeSnapshot
impl Eq for TimeSnapshot
Source§impl PartialEq for TimeSnapshot
impl PartialEq for TimeSnapshot
impl StructuralPartialEq for TimeSnapshot
Auto Trait Implementations§
impl Freeze for TimeSnapshot
impl RefUnwindSafe for TimeSnapshot
impl Send for TimeSnapshot
impl Sync for TimeSnapshot
impl Unpin for TimeSnapshot
impl UnsafeUnpin for TimeSnapshot
impl UnwindSafe for TimeSnapshot
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,
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 more