pub struct EffectiveDateBound {
pub from: NaiveDate,
pub until: Option<NaiveDate>,
}Expand description
The calendar range within which a ruleset version is legally valid.
Fields§
§from: NaiveDateFirst day this ruleset version applies (inclusive).
until: Option<NaiveDate>Last day this ruleset version applies (inclusive), or None if open-ended.
Implementations§
Source§impl EffectiveDateBound
impl EffectiveDateBound
pub fn open(from: NaiveDate) -> Self
pub fn is_active_on(&self, date: NaiveDate) -> bool
Sourcepub fn ensure_active_on(
&self,
id: &RulesetId,
date: NaiveDate,
) -> Result<(), CalcError>
pub fn ensure_active_on( &self, id: &RulesetId, date: NaiveDate, ) -> Result<(), CalcError>
Error if date falls outside the effective period, distinguishing a
ruleset that is not yet effective (before from) from one that has
expired (after until) — so a pending 2100 stub is never reported
as “expired”.
Trait Implementations§
Source§impl Clone for EffectiveDateBound
impl Clone for EffectiveDateBound
Source§fn clone(&self) -> EffectiveDateBound
fn clone(&self) -> EffectiveDateBound
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for EffectiveDateBound
impl Debug for EffectiveDateBound
Source§impl<'de> Deserialize<'de> for EffectiveDateBound
impl<'de> Deserialize<'de> for EffectiveDateBound
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for EffectiveDateBound
impl PartialEq for EffectiveDateBound
Source§impl Serialize for EffectiveDateBound
impl Serialize for EffectiveDateBound
impl StructuralPartialEq for EffectiveDateBound
Auto Trait Implementations§
impl Freeze for EffectiveDateBound
impl RefUnwindSafe for EffectiveDateBound
impl Send for EffectiveDateBound
impl Sync for EffectiveDateBound
impl Unpin for EffectiveDateBound
impl UnsafeUnpin for EffectiveDateBound
impl UnwindSafe for EffectiveDateBound
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
Mutably borrows from an owned value. Read more