Skip to main content

StatsTimeState

Struct StatsTimeState 

Source
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: TimeSnapshot

The current entries and retained time History over the project’s active issues.

§filter: TimeFilter

The scope the reader is looking through: issue, assignee, period, or none.

§breakdown: TimeBreakdown

The dimension the summary breaks down by.

§audit: bool

Whether the audit view is on (the H toggle) — the CLI’s --audit.

§cursor: usize

Which entry row the mutations act on, as an index into Self::rows.

Implementations§

Source§

impl StatsTimeState

Source

pub fn new(snapshot: TimeSnapshot) -> Self

A fresh tab over snapshot, with the empty filter, no breakdown and no audit.

Source

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).

Source

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).

Source

pub fn selected(&self) -> Option<&IndexedEntry>

The row the e/x mutations act on.

Source

pub fn clamp(&mut self)

Keep the cursor inside the rows (called after every refresh, so a deletion cannot leave it past the end).

Source

pub fn move_cursor(&mut self, delta: isize)

Move the cursor delta rows, clamped into the rows the filter selects.

Source

pub fn total(&self) -> TimeTotal

The scope’s total, from the shared calculation.

Source

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.

Source

pub fn audit_view(&self) -> TimeAudit

The explicit audit view, from the shared calculation.

Trait Implementations§

Source§

impl Clone for StatsTimeState

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for StatsTimeState

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for StatsTimeState

Source§

impl PartialEq for StatsTimeState

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for StatsTimeState

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.