pub struct TemporalVersion {
pub version_id: String,
pub issued_date: Option<NaiveDate>,
pub early_adoption_from: Option<NaiveDate>,
pub effective_from: NaiveDate,
pub superseded_at: Option<NaiveDate>,
pub jurisdiction_overrides: HashMap<String, NaiveDate>,
pub change_summary: Vec<String>,
pub impact: ChangeImpact,
}Expand description
A specific version of a standard with temporal bounds.
Fields§
§version_id: StringVersion identifier (e.g., “2018”, “2020-amended”, “2023-revised”)
issued_date: Option<NaiveDate>Date this version was issued/published
early_adoption_from: Option<NaiveDate>Date this version becomes available for early adoption
effective_from: NaiveDateDate this version becomes mandatory (global default)
superseded_at: Option<NaiveDate>Date this version is superseded (None = currently active)
jurisdiction_overrides: HashMap<String, NaiveDate>Per-jurisdiction effective date overrides
change_summary: Vec<String>Key changes from the previous version
impact: ChangeImpactImpact level on generated data
Implementations§
Source§impl TemporalVersion
impl TemporalVersion
Sourcepub fn new(
version_id: impl Into<String>,
effective_from: NaiveDate,
impact: ChangeImpact,
) -> Self
pub fn new( version_id: impl Into<String>, effective_from: NaiveDate, impact: ChangeImpact, ) -> Self
Creates a new temporal version with required fields.
Sourcepub fn with_issued_date(self, date: NaiveDate) -> Self
pub fn with_issued_date(self, date: NaiveDate) -> Self
Sets the issued date.
Sourcepub fn with_early_adoption(self, date: NaiveDate) -> Self
pub fn with_early_adoption(self, date: NaiveDate) -> Self
Sets the early adoption date.
Sourcepub fn superseded_at(self, date: NaiveDate) -> Self
pub fn superseded_at(self, date: NaiveDate) -> Self
Sets the superseded date.
Sourcepub fn with_jurisdiction_override(self, country: &str, date: NaiveDate) -> Self
pub fn with_jurisdiction_override(self, country: &str, date: NaiveDate) -> Self
Adds a jurisdiction-specific effective date override.
Sourcepub fn with_change(self, summary: impl Into<String>) -> Self
pub fn with_change(self, summary: impl Into<String>) -> Self
Adds a change summary item.
Sourcepub fn is_active_at(&self, date: NaiveDate) -> bool
pub fn is_active_at(&self, date: NaiveDate) -> bool
Returns whether this version is active at a given date (global, ignoring jurisdiction overrides).
Sourcepub fn is_active_at_in(&self, date: NaiveDate, country: &str) -> bool
pub fn is_active_at_in(&self, date: NaiveDate, country: &str) -> bool
Returns whether this version is active at a given date for a specific jurisdiction.
Sourcepub fn effective_date_for(&self, country: &str) -> NaiveDate
pub fn effective_date_for(&self, country: &str) -> NaiveDate
Returns the effective date for a specific jurisdiction.
Sourcepub fn days_active_at(&self, date: NaiveDate) -> Option<i64>
pub fn days_active_at(&self, date: NaiveDate) -> Option<i64>
Returns the number of days this version has been active as of a given date.
Trait Implementations§
Source§impl Clone for TemporalVersion
impl Clone for TemporalVersion
Source§fn clone(&self) -> TemporalVersion
fn clone(&self) -> TemporalVersion
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more