pub enum Effectivity {
InForce {
from: NaiveDate,
until: Option<NaiveDate>,
},
Pending {
empowerment: &'static str,
adoption_deadline: Option<NaiveDate>,
},
}Expand description
Whether, and from when, a ruleset version is legally in force.
The two variants are not “now” and “later” — they are “we know the date” and “the date is not knowable yet”. EU staged obligations are routinely written as “from <date> or N months after the entry into force of <act>, whichever is the latest” — see Regulation (EU) 2023/1542 Art. 7(1)–(3), Art. 8(1) and Art. 10(2)–(3). Until that act enters into force the application date is genuinely unknown, and asserting one anyway (a far-future sentinel, say) states a fact the regulation does not.
Variants§
InForce
In force from a known calendar date, until an optional end date.
Fields
Pending
The instrument that will date this ruleset has not entered into force, so no application date can be stated.
Implementations§
Source§impl Effectivity
impl Effectivity
Sourcepub const fn pending(
empowerment: &'static str,
adoption_deadline: Option<NaiveDate>,
) -> Self
pub const fn pending( empowerment: &'static str, adoption_deadline: Option<NaiveDate>, ) -> Self
Awaiting an instrument that has not entered into force.
Sourcepub fn is_active_on(&self, date: NaiveDate) -> bool
pub fn is_active_on(&self, date: NaiveDate) -> bool
Whether this ruleset governs date.
A Pending ruleset governs no date at all — not even a
far-future one.
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 unless this ruleset governs date.
Distinguishes three outcomes that must never be conflated: a ruleset that is not yet effective on a known date, one that has expired, and one whose date is undetermined because the instrument dating it has not entered into force.
Trait Implementations§
Source§impl Clone for Effectivity
impl Clone for Effectivity
Source§fn clone(&self) -> Effectivity
fn clone(&self) -> Effectivity
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more