Skip to main content

TimeSnapshot

Struct TimeSnapshot 

Source
pub struct TimeSnapshot { /* private fields */ }
Expand description

One read-only index of current entries and retained time History (T014).

Implementations§

Source§

impl TimeSnapshot

Source

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

Source

pub fn entries(&self) -> &[IndexedEntry]

Every indexed entry, in the snapshot’s deterministic order.

Source

pub fn issues(&self) -> &[u32]

Every issue number the snapshot holds, ascending.

Source

pub fn holds_issue(&self, number: u32) -> bool

Whether the snapshot holds this issue — with or without entries.

Source

pub fn deletions_on(&self, issue: u32) -> &[TimeDeletion]

The prior values deletions left in one issue’s History, in History order.

Source

pub fn corrections_on(&self, issue: u32) -> usize

How many corrections one issue’s History retains.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fn audit(&self, filter: &TimeFilter) -> TimeAudit

The explicit audit view for one scope (T017).

Trait Implementations§

Source§

impl Clone for TimeSnapshot

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 TimeSnapshot

Source§

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

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

impl Default for TimeSnapshot

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Eq for TimeSnapshot

Source§

impl PartialEq for TimeSnapshot

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 TimeSnapshot

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.