pub enum Cost {
None,
Unverified,
Fixed(Money),
Fuses(&'static [(u16, Money)]),
FusesYearlyConsumption(&'static [(u16, Option<u32>, Money)]),
FuseRange(&'static [(u16, u16, Money)]),
}Variants§
None
Unverified
Cost has not been verified
Fixed(Money)
Fuses(&'static [(u16, Money)])
FusesYearlyConsumption(&'static [(u16, Option<u32>, Money)])
Fuse size combined with a yearly energy consumption limit
FuseRange(&'static [(u16, u16, Money)])
Implementations§
Source§impl Cost
impl Cost
pub const fn fuses(values: &'static [(u16, Money)]) -> Self
pub const fn fuse_range(ranges: &'static [(u16, u16, Money)]) -> Self
pub const fn fuses_with_yearly_consumption( values: &'static [(u16, Option<u32>, Money)], ) -> Self
pub const fn fixed(int: i64, fract: u8) -> Self
pub const fn fixed_yearly(int: i64, fract: u8) -> Self
pub const fn fixed_subunit(subunit: f64) -> Self
pub const fn is_unverified(&self) -> bool
pub const fn divide_by(&self, by: i64) -> Self
pub const fn cost_for( &self, fuse_size: u16, yearly_consumption: u32, ) -> Option<Money>
pub const fn add_vat(&self, country: Country) -> Cost
pub fn is_yearly_consumption_based(&self, fuse_size: u16) -> bool
Trait Implementations§
impl Copy for Cost
Auto Trait Implementations§
impl Freeze for Cost
impl RefUnwindSafe for Cost
impl Send for Cost
impl Sync for Cost
impl Unpin for Cost
impl UnwindSafe for Cost
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