pub struct StatsTimeState {
pub snapshot: TimeSnapshot,
pub filter: TimeFilter,
pub breakdown: TimeBreakdown,
pub audit: bool,
pub cursor: usize,
}Expand description
The F7 Stats page’s Time tab session state (WP05 T026).
Holds the tab’s one read — the shared
crate::time_tracking::aggregate::TimeSnapshot — rather than re-reading every
issue per frame, exactly as the portfolio tabs cache their projections; the
snapshot is rebuilt when the tab is opened and after every mutation, never during
a render.
Nothing here is a total of its own. Self::total and Self::groups call the
shared calculation, the filter is the shared TimeFilter (its validation is that
type’s own problems), and the entry rows are the snapshot’s own index — so the
tab, the CLI and the pane cannot disagree about a figure (C-005, C-006, NFR-003).
Fields§
§snapshot: TimeSnapshotThe current entries and retained time History over the project’s active issues.
filter: TimeFilterThe scope the reader is looking through: issue, assignee, period, or none.
breakdown: TimeBreakdownThe dimension the summary breaks down by.
audit: boolWhether the audit view is on (the H toggle) — the CLI’s --audit.
cursor: usizeWhich entry row the mutations act on, as an index into Self::rows.
Implementations§
Source§impl StatsTimeState
impl StatsTimeState
Sourcepub fn new(snapshot: TimeSnapshot) -> Self
pub fn new(snapshot: TimeSnapshot) -> Self
A fresh tab over snapshot, with the empty filter, no breakdown and no audit.
Sourcepub fn scope(&self) -> TimeFilter
pub fn scope(&self) -> TimeFilter
The filter the tab evaluates: the reader’s scope, with the deleted context
asked for when the audit view is on — the CLI’s --audit, which is the same
request (deleted_count is Some only when it was asked for).
Sourcepub fn rows(&self) -> Vec<&IndexedEntry>
pub fn rows(&self) -> Vec<&IndexedEntry>
The entry rows the cursor walks: the snapshot’s current entries the filter selects, in the snapshot’s own deterministic order (issue, then the entry’s display order).
Sourcepub fn selected(&self) -> Option<&IndexedEntry>
pub fn selected(&self) -> Option<&IndexedEntry>
The row the e/x mutations act on.
Sourcepub fn clamp(&mut self)
pub fn clamp(&mut self)
Keep the cursor inside the rows (called after every refresh, so a deletion cannot leave it past the end).
Sourcepub fn move_cursor(&mut self, delta: isize)
pub fn move_cursor(&mut self, delta: isize)
Move the cursor delta rows, clamped into the rows the filter selects.
Sourcepub fn groups(&self) -> Vec<TimeTotal>
pub fn groups(&self) -> Vec<TimeTotal>
The breakdown’s groups, from the shared calculation. Empty for
[TimeBreakdown::All], which is the scope’s one ungrouped total already.
Sourcepub fn audit_view(&self) -> TimeAudit
pub fn audit_view(&self) -> TimeAudit
The explicit audit view, from the shared calculation.
Trait Implementations§
Source§impl Clone for StatsTimeState
impl Clone for StatsTimeState
Source§impl Debug for StatsTimeState
impl Debug for StatsTimeState
impl Eq for StatsTimeState
Source§impl PartialEq for StatsTimeState
impl PartialEq for StatsTimeState
impl StructuralPartialEq for StatsTimeState
Auto Trait Implementations§
impl Freeze for StatsTimeState
impl RefUnwindSafe for StatsTimeState
impl Send for StatsTimeState
impl Sync for StatsTimeState
impl Unpin for StatsTimeState
impl UnsafeUnpin for StatsTimeState
impl UnwindSafe for StatsTimeState
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