pub struct SectorCalculatorEntry {
pub sector_key: &'static str,
pub product_category: &'static str,
pub methodology: &'static str,
pub implementation: CalculatorImpl,
}Fields§
§sector_key: &'static strSector key from the SectorCatalog (e.g. "electronics", "battery").
product_category: &'static strProduct category within the sector (e.g. "smartphone-tablet").
methodology: &'static strMethodology identifier (e.g. "repairability-heuristic", "co2e-pef").
implementation: CalculatorImplWhat implements this pair. Status is derived from it.
Implementations§
Source§impl SectorCalculatorEntry
impl SectorCalculatorEntry
Sourcepub fn status_on(&self, law_in_force_on: NaiveDate) -> CalculatorStatus
pub fn status_on(&self, law_in_force_on: NaiveDate) -> CalculatorStatus
Status for a product whose governing law was fixed on law_in_force_on.
Takes the date rather than reading the clock: a readiness view for “today” and a readiness view for a product placed on the market in 2030 are different questions, and the caller knows which it is asking.
Auto Trait Implementations§
impl Freeze for SectorCalculatorEntry
impl RefUnwindSafe for SectorCalculatorEntry
impl Send for SectorCalculatorEntry
impl Sync for SectorCalculatorEntry
impl Unpin for SectorCalculatorEntry
impl UnsafeUnpin for SectorCalculatorEntry
impl UnwindSafe for SectorCalculatorEntry
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