pub struct AnalyticsScope {
pub kind: ScopeKind,
pub id: String,
pub period: Period,
pub snapshot_id: Option<String>,
}Expand description
The selected cycle/milestone and its period context (data-model.md §1).
The snapshot_id is the closed-series binding: when it is present the scope
refers to a closed historical view, and events after the period’s end are not
contributions to it (C-006 — a later edit never rewrites a closed series).
Fields§
§kind: ScopeKindWhich planning entity the id names.
id: StringThe stable planning identity (a cycle name, a milestone name).
period: PeriodThe inclusive period context.
snapshot_id: Option<String>The closed snapshot this series is bound to, when it is bound to one.
Implementations§
Source§impl AnalyticsScope
impl AnalyticsScope
Sourcepub fn new(
kind: ScopeKind,
id: impl Into<String>,
period: Period,
) -> Result<Self>
pub fn new( kind: ScopeKind, id: impl Into<String>, period: Period, ) -> Result<Self>
A scope. A blank id is refused: an unnamed scope cannot be reported or compared, and defaulting it would hide the caller’s mistake.
Sourcepub fn with_snapshot_id(self, snapshot_id: impl Into<String>) -> Self
pub fn with_snapshot_id(self, snapshot_id: impl Into<String>) -> Self
Bind this scope to a closed snapshot’s stable identity (C-006).
Sourcepub fn period_start(&self) -> Option<&str>
pub fn period_start(&self) -> Option<&str>
The inclusive period start, when the planning data declares one.
Sourcepub fn period_end(&self) -> Option<&str>
pub fn period_end(&self) -> Option<&str>
The inclusive period end, when the planning data declares one.
Sourcepub fn is_closed(&self) -> bool
pub fn is_closed(&self) -> bool
Whether this scope is closed: bound to a snapshot or bounded by an end date.
A closed scope’s series stops at its period, which is what keeps a later edit from extending a historical view.
Sourcepub fn contains(&self, date: &str) -> bool
pub fn contains(&self, date: &str) -> bool
Whether date belongs to this scope’s period. An event with no readable day
is handled by EventIndex::contribute, not here.
Trait Implementations§
Source§impl Clone for AnalyticsScope
impl Clone for AnalyticsScope
Source§impl Debug for AnalyticsScope
impl Debug for AnalyticsScope
Source§impl Display for AnalyticsScope
impl Display for AnalyticsScope
impl Eq for AnalyticsScope
Source§impl PartialEq for AnalyticsScope
impl PartialEq for AnalyticsScope
impl StructuralPartialEq for AnalyticsScope
Auto Trait Implementations§
impl Freeze for AnalyticsScope
impl RefUnwindSafe for AnalyticsScope
impl Send for AnalyticsScope
impl Sync for AnalyticsScope
impl Unpin for AnalyticsScope
impl UnsafeUnpin for AnalyticsScope
impl UnwindSafe for AnalyticsScope
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 moreSource§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
CompactString. Read more