pub struct BurndownState {
pub choices: Vec<AnalyticsScope>,
pub choice: usize,
pub period: BurndownPeriod,
pub mode: Mode,
pub units: Vec<String>,
pub unit: usize,
pub forecast: bool,
pub origin_back: usize,
pub cursor: usize,
pub document: Option<ChartExport>,
pub problem: Option<String>,
}Expand description
The F7 Stats page’s Burndown tab session state (T029–T032).
Every selection lives here and nowhere else: the scope, the period source, the mode, the
unit, whether the forecast is asked for, and the forecast’s origin. Nothing is persisted
(a session default is not a preference), nothing is a total, and the tab’s one read —
the shared ChartExport — is rebuilt when the tab is opened and after every control,
never during a render.
The origin is held as a count of days back from the series’ last covered day, so a refresh cannot leave it pointing at a day the fold no longer holds: the projection’s own refusal for an uncovered day is a statement the tab should never have to make.
Fields§
§choices: Vec<AnalyticsScope>The scopes the record offers, resolved through the crate’s own scope resolver.
choice: usizeWhich choice is selected, as an index into Self::choices.
period: BurndownPeriodWhich period source the series is folded over.
mode: ModeHow the series counts.
units: Vec<String>The units the project declares a conversion for (crate::analytics::units::declared_units).
unit: usizeWhich unit is selected, as an index into Self::units. Remembered in count mode,
where the fold ignores it, so switching back does not lose the reader’s choice.
forecast: boolWhether the forecast is asked for.
origin_back: usizeThe forecast origin: how many covered days back from the series’ last covered day.
cursor: usizeWhich daily row the cursor is on, as an index into the series’ points.
document: Option<ChartExport>The document the tab is showing, None when no fold has produced one.
problem: Option<String>Why the last fold produced no document — a read that failed, or a request the record cannot carry. An explicit state, never a blank pane.
Implementations§
Source§impl BurndownState
impl BurndownState
Sourcepub fn new(choices: Vec<AnalyticsScope>, units: Vec<String>) -> Self
pub fn new(choices: Vec<AnalyticsScope>, units: Vec<String>) -> Self
A fresh tab over choices, with the scope’s own period, count mode, unit 0, no
forecast, the origin on the series’ last covered day and the cursor on the first row.
Sourcepub fn selected(&self) -> Option<&AnalyticsScope>
pub fn selected(&self) -> Option<&AnalyticsScope>
The selected choice, when the record offers one.
Sourcepub fn scope(&self) -> Option<AnalyticsScope>
pub fn scope(&self) -> Option<AnalyticsScope>
The scope the fold is asked for: the selection with Self::period applied.
The closed-snapshot binding travels with the choice (the record’s close evidence), so it survives the period change — a snapshot-bound scope stays bound whatever period the reader looks through, which is what C-006 requires of a historical view.
Sourcepub fn unit(&self) -> Option<&str>
pub fn unit(&self) -> Option<&str>
The unit the fold is asked for: the selection, and only in estimate mode — a count is
unitless, which is what the CLI’s --unit does too.
Sourcepub fn origin(&self) -> Option<&DailyPoint>
pub fn origin(&self) -> Option<&DailyPoint>
The forecast origin: the covered day Self::origin_back days back from the last one.
Sourcepub fn projection(&self) -> Option<(String, String)>
pub fn projection(&self) -> Option<(String, String)>
The forecast to ask the document for, as (as_of, end_date) — the same pair the CLI
passes as --as-of and the scope’s planning end.
None when the forecast is off, when there is no covered day to stand on, or when the
effective period declares no end: the caller renders each of those states explicitly
rather than asking for a forecast the record cannot bound.
Sourcepub fn shift_scope(&mut self, delta: isize)
pub fn shift_scope(&mut self, delta: isize)
Switch to the scope delta steps away, wrapping — so one key reaches every scope from
either side, exactly as the page’s tab strip does.
Sourcepub fn cycle_period(&mut self)
pub fn cycle_period(&mut self)
The other period source (T030).
Sourcepub fn cycle_mode(&mut self)
pub fn cycle_mode(&mut self)
The other mode: count ↔ estimate (T030).
Sourcepub fn cycle_unit(&mut self)
pub fn cycle_unit(&mut self)
The next unit the project declares, wrapping; inert when it declares none.
Sourcepub fn toggle_forecast(&mut self)
pub fn toggle_forecast(&mut self)
Ask for the forecast, or stop asking for it.
Sourcepub fn origin_earlier(&mut self)
pub fn origin_earlier(&mut self)
Move the forecast origin one covered day earlier, to the series’ first day at most.
Sourcepub fn origin_later(&mut self)
pub fn origin_later(&mut self)
Move the forecast origin one covered day later, to the series’ last day at most.
Sourcepub fn move_cursor(&mut self, delta: isize)
pub fn move_cursor(&mut self, delta: isize)
Move the daily cursor delta rows, clamped into the days the document holds.
Trait Implementations§
Source§impl Clone for BurndownState
impl Clone for BurndownState
Source§impl Debug for BurndownState
impl Debug for BurndownState
Source§impl PartialEq for BurndownState
impl PartialEq for BurndownState
impl StructuralPartialEq for BurndownState
Auto Trait Implementations§
impl Freeze for BurndownState
impl RefUnwindSafe for BurndownState
impl Send for BurndownState
impl Sync for BurndownState
impl Unpin for BurndownState
impl UnsafeUnpin for BurndownState
impl UnwindSafe for BurndownState
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<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