Skip to main content

TimeFilter

Struct TimeFilter 

Source
pub struct TimeFilter {
    pub issue: Option<u32>,
    pub assignee: Option<String>,
    pub date_from: Option<String>,
    pub date_to: Option<String>,
    pub include_deleted: bool,
}
Expand description

The normalized, read-only issue/assignee/period selector (data-model §3).

Every field is optional and every named one is required to match — the AND rule above. Self::include_deleted is the one field that selects nothing: it is the explicit audit context, and it only ever widens what is reported about the entries the other criteria already selected, never what is summed (T017).

The assignee criterion names the identity that did the work — the entry’s author — because that is the one identity a time entry carries (data-model §1). The issue’s own assignee is ownership, and this read-only module does not filter on it, so a time operation can never appear to change who owns the issue (C-008).

Fields§

§issue: Option<u32>

The stable issue number to select, or None for every issue.

§assignee: Option<String>

The identity that did the work, or None for every identity.

§date_from: Option<String>

The inclusive lower calendar bound, YYYY-MM-DD.

§date_to: Option<String>

The inclusive upper calendar bound, YYYY-MM-DD.

§include_deleted: bool

Whether to report the deleted entries History retains (audit context).

Implementations§

Source§

impl TimeFilter

Source

pub const fn new() -> Self

A filter with no criteria: it selects every entry.

Source

pub fn for_issue(self, number: u32) -> Self

Select one issue by its stable number.

Source

pub fn for_assignee(self, assignee: impl Into<String>) -> Self

Select the entries one identity did.

Source

pub fn since(self, date: impl Into<String>) -> Self

Bound the period from below, inclusively.

Source

pub fn until(self, date: impl Into<String>) -> Self

Bound the period from above, inclusively.

Source

pub fn between(self, start: impl Into<String>, end: impl Into<String>) -> Self

Bound the period on both sides, inclusively.

Source

pub fn including_deleted(self) -> Self

Report the deleted entries History retains, too (audit context, T017).

Source

pub const fn is_unfiltered(&self) -> bool

Whether the filter names no criterion at all.

Source

pub const fn has_period(&self) -> bool

Whether the filter names a calendar period.

Source

pub fn problems(&self) -> Vec<TimeFilterError>

Every reason the filter cannot be used as written, in field order; empty means valid.

The bounds are checked with the crate’s calendar validator and the assignee with the crate’s identity parser, so “valid” here means the same thing it means everywhere else. An inverted period is only reported when both bounds are themselves valid: reporting both a bad bound and an inversion derived from it would name one mistake twice.

Source

pub fn validate(&self) -> Result<(), Vec<TimeFilterError>>

Refuse the filter unless every criterion is usable.

Source

pub fn is_valid(&self) -> bool

Whether every criterion is usable.

Source

pub fn canonical_assignee(&self) -> Option<String>

The assignee criterion in canonical identity form, resolved once.

What Self::selects compares against, and what an aggregation should resolve once instead of re-parsing per entry (T014).

Source

pub fn place(&self, date: Option<&str>) -> PeriodPlacement

Where date falls relative to this filter’s period (T013).

A filter that names no bounds places every date in the period, including an entry with no date and an entry whose date is unreadable: with no period there is nothing to fail to place, and the entry’s own problems are reported by the aggregation that reads its fields.

The bounds are assumed readable — Self::problems is checked before any aggregation, and Self::selects refuses an invalid filter outright. A malformed bound is never read here, so it can never be mistaken for “no bound” by a caller that validated its filter.

Source

pub fn selects(&self, issue: u32, entry: &TimeEntry) -> bool

Whether one entry of one issue is selected by the whole predicate.

The AND rule, in one place: the issue criterion, then the assignee criterion, then the period placement. An invalid criterion selects nothing rather than being skipped: an unreadable bound must not behave as no bound and a blank identity must not match every author, because both would read a mistake as a wider scope than the caller asked for. Self::problems is where the reason is reported. For a pass over many entries resolve Self::canonical_assignee once instead: this convenience canonicalizes the criterion per call.

Source

pub fn describe(&self) -> String

A short label for the scope, for a heading or a payload (C-006).

One spelling for every surface: issue #3, assignee @ada, period 2026-03-01..2026-03-31, audit, joined by , , or all when the filter names nothing.

Trait Implementations§

Source§

impl Clone for TimeFilter

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 TimeFilter

Source§

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

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

impl Default for TimeFilter

Source§

fn default() -> Self

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

impl Display for TimeFilter

Source§

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

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

impl Eq for TimeFilter

Source§

impl PartialEq for TimeFilter

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 TimeFilter

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> ToCompactString for T
where T: Display,

Source§

impl<T> ToLine for T
where T: Display,

Source§

fn to_line(&self) -> Line<'_>

Converts the value to a Line.
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> ToSpan for T
where T: Display,

Source§

fn to_span(&self) -> Span<'_>

Converts the value to a Span.
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T> ToText for T
where T: Display,

Source§

fn to_text(&self) -> Text<'_>

Converts the value to a Text.
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.