pub struct Period {
pub start: Option<String>,
pub end: Option<String>,
}Expand description
The inclusive calendar period a series covers (data-model.md §1).
Both bounds are caller-supplied YYYY-MM-DD strings — this module reads no
clock — and each is optional because a cycle need not declare its dates: an
absent bound is “unbounded on that side”, which is coverage, not a guess. The
bounds come from existing planning data ([cycle_scope]/[milestone_scope]),
never from an assumption about when work started.
Comparison is &str comparison, which is chronological for that fixed-width
shape and needs no date arithmetic.
Fields§
§start: Option<String>Inclusive start, or None for “unbounded from the beginning”.
end: Option<String>Inclusive end, or None for “still open”.
Implementations§
Source§impl Period
impl Period
Sourcepub fn new(start: Option<String>, end: Option<String>) -> Result<Self>
pub fn new(start: Option<String>, end: Option<String>) -> Result<Self>
A validated period: each present bound must be a canonical calendar date and
start <= end must hold.
A malformed bound is refused here rather than silently dropped, because a period that quietly lost an end date would turn a closed series into an open one — the one thing C-006 forbids.
Sourcepub fn is_bounded(&self) -> bool
pub fn is_bounded(&self) -> bool
Whether the period constrains anything at all.
Trait Implementations§
impl Eq for Period
impl StructuralPartialEq for Period
Auto Trait Implementations§
impl Freeze for Period
impl RefUnwindSafe for Period
impl Send for Period
impl Sync for Period
impl Unpin for Period
impl UnsafeUnpin for Period
impl UnwindSafe for Period
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 more