pub struct Reduktionsfaktor(/* private fields */);Expand description
A §14a Modul 2 reduction factor — the fraction of the published Arbeitspreis actually paid.
Modul 2 is the prozentuale reduction; Modul 1 is the flat annual pauschale
and carries no factor at all (see ArbeitspreisModell::Modul1Pauschal).
A newtype because the range matters: 0.85 is a 15 % reduction, and a value
outside (0, 1] is not a reduction at all. The unconstrained Decimal this
replaces was range-checked in the validator and not in the engine, so a
caller who skipped validation could multiply the tariff by 5.
Implementations§
Source§impl Reduktionsfaktor
impl Reduktionsfaktor
Sourcepub const REGELFALL: Self
pub const REGELFALL: Self
A commonly published factor — 85 % of the tariff, i.e. a 15 % reduction.
Not a statutory rate: BK8-22/010-A leaves the Modul-2 percentage to each Netzbetreiber’s published Preisblatt, so this is a convenience default and never a substitute for the operator’s own figure.
Sourcepub fn new(factor: Decimal) -> Result<Self, BillingError>
pub fn new(factor: Decimal) -> Result<Self, BillingError>
Trait Implementations§
Source§impl Clone for Reduktionsfaktor
impl Clone for Reduktionsfaktor
Source§fn clone(&self) -> Reduktionsfaktor
fn clone(&self) -> Reduktionsfaktor
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for Reduktionsfaktor
Source§impl Debug for Reduktionsfaktor
impl Debug for Reduktionsfaktor
Source§impl<'de> Deserialize<'de> for Reduktionsfaktor
Deserialising goes through Reduktionsfaktor::new, so a factor that
arrives over the wire is range-checked exactly like one built in process.
impl<'de> Deserialize<'de> for Reduktionsfaktor
Deserialising goes through Reduktionsfaktor::new, so a factor that
arrives over the wire is range-checked exactly like one built in process.
Deriving it would have reintroduced the unconstrained Decimal this newtype
exists to prevent: a request body carrying 5 would then multiply the
Arbeitspreis by five with no error anywhere.