pub struct SettlementPeriod { /* private fields */ }Expand description
The delivery period a settlement covers.
A validated pair rather than two loose dates. Every input struct previously
carried period_from and period_to independently, and every calculation
re-checked their ordering — five copies of the same guard, each able to be
forgotten. Constructing this type is the check.
Both bounds are inclusive: a monthly period runs from the 1st to the last day of the month, matching how Netzentgelte are published and billed.
Implementations§
Source§impl SettlementPeriod
impl SettlementPeriod
Sourcepub fn new(from: Date, to: Date) -> Result<Self, BillingError>
pub fn new(from: Date, to: Date) -> Result<Self, BillingError>
Build a period.
§Errors
Returns crate::error::BillingError::InvalidInput when from is after to. A
zero-length period (from == to) is a valid single day.
Trait Implementations§
Source§impl Clone for SettlementPeriod
impl Clone for SettlementPeriod
Source§fn clone(&self) -> SettlementPeriod
fn clone(&self) -> SettlementPeriod
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for SettlementPeriod
Source§impl Debug for SettlementPeriod
impl Debug for SettlementPeriod
impl Eq for SettlementPeriod
Source§impl PartialEq for SettlementPeriod
impl PartialEq for SettlementPeriod
Source§impl Serialize for SettlementPeriod
impl Serialize for SettlementPeriod
impl StructuralPartialEq for SettlementPeriod
Auto Trait Implementations§
impl Freeze for SettlementPeriod
impl RefUnwindSafe for SettlementPeriod
impl Send for SettlementPeriod
impl Sync for SettlementPeriod
impl Unpin for SettlementPeriod
impl UnsafeUnpin for SettlementPeriod
impl UnwindSafe for SettlementPeriod
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