pub enum Assessability<T> {
Assessed(T),
NotYetInForce {
ruleset_id: &'static str,
applies_from: NaiveDate,
},
Undetermined {
ruleset_id: &'static str,
empowerment: &'static str,
},
Expired {
ruleset_id: &'static str,
until: NaiveDate,
superseded_by: Option<&'static str>,
},
OutOfScope,
}Expand description
The outcome of asking “which ruleset governs this product?”.
Deliberately not Option. None collapses four legally distinct answers
into one, and the difference between them is what an operator is actually
owed: “this regulation does not cover your product”, “it will cover it
from a date we can name”, “we are waiting on an act that has not been
adopted” and “the rule that covered it has been replaced” carry different
obligations and different next actions. Reporting any of them as
non-compliance — or as a silent blank — misstates the operator’s position.
Variants§
Assessed(T)
A governing ruleset was found.
NotYetInForce
A ruleset covers this product, from a known date that has not arrived.
Undetermined
A ruleset exists but the instrument that would date it has not entered
into force, so it has no application date at all. Distinct from
NotYetInForce: there is no date to wait for yet.
Expired
The ruleset that covered this product has ended.
Fields
OutOfScope
No ruleset covers this product category at all.
Implementations§
Source§impl<T> Assessability<T>
impl<T> Assessability<T>
Sourcepub fn assessed(self) -> Option<T>
pub fn assessed(self) -> Option<T>
The governing ruleset, discarding the reason when there isn’t one.
Use only where the caller genuinely has nothing to say about why — anything user-facing should match on the variant instead.
Sourcepub const fn is_assessed(&self) -> bool
pub const fn is_assessed(&self) -> bool
Whether a governing ruleset was found.
Trait Implementations§
Source§impl<T: Clone> Clone for Assessability<T>
impl<T: Clone> Clone for Assessability<T>
Source§fn clone(&self) -> Assessability<T>
fn clone(&self) -> Assessability<T>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more