pub struct Decimal3(/* private fields */);Expand description
A non-negative decimal with at most 3 fractional digits, used for power quantities (0–999999.999 MW) and percentages (0–100.000 %).
Implementations§
Source§impl Decimal3
impl Decimal3
Sourcepub fn new(v: f64) -> Result<Self, RedispatchXmlError>
pub fn new(v: f64) -> Result<Self, RedispatchXmlError>
Create a new value. Returns an error if v is negative.
Note: due to binary floating-point representation, values with more than 3 fractional digits are accepted but will be rounded to 3 places on serialization. For exact decimal arithmetic use external rounding before construction.
Trait Implementations§
impl Copy for Decimal3
Source§impl<'de> Deserialize<'de> for Decimal3
impl<'de> Deserialize<'de> for Decimal3
Source§fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialOrd for Decimal3
impl PartialOrd for Decimal3
impl StructuralPartialEq for Decimal3
Auto Trait Implementations§
impl Freeze for Decimal3
impl RefUnwindSafe for Decimal3
impl Send for Decimal3
impl Sync for Decimal3
impl Unpin for Decimal3
impl UnsafeUnpin for Decimal3
impl UnwindSafe for Decimal3
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