pub struct NonNegativeDecimal(/* private fields */);Expand description
Decimal constrained to x >= 0.
Implementations§
Source§impl NonNegativeDecimal
impl NonNegativeDecimal
Sourcepub fn new(value: Decimal) -> Result<Self, DecimalConstraintError>
pub fn new(value: Decimal) -> Result<Self, DecimalConstraintError>
Sourcepub const fn as_decimal(&self) -> &Decimal
pub const fn as_decimal(&self) -> &Decimal
Returns the wrapped decimal by reference.
Sourcepub const fn into_inner(self) -> Decimal
Available on non-crate feature bigdecimal only.
pub const fn into_inner(self) -> Decimal
bigdecimal only.Returns the wrapped decimal.
Trait Implementations§
Source§impl AsRef<Decimal> for NonNegativeDecimal
impl AsRef<Decimal> for NonNegativeDecimal
Source§impl Clone for NonNegativeDecimal
impl Clone for NonNegativeDecimal
Source§fn clone(&self) -> NonNegativeDecimal
fn clone(&self) -> NonNegativeDecimal
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 NonNegativeDecimal
Source§impl Debug for NonNegativeDecimal
impl Debug for NonNegativeDecimal
Source§impl<'de> Deserialize<'de> for NonNegativeDecimal
impl<'de> Deserialize<'de> for NonNegativeDecimal
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for NonNegativeDecimal
impl Display for NonNegativeDecimal
impl Eq for NonNegativeDecimal
Source§impl From<NonNegativeDecimal> for Decimal
impl From<NonNegativeDecimal> for Decimal
Source§fn from(value: NonNegativeDecimal) -> Self
fn from(value: NonNegativeDecimal) -> Self
Converts to this type from the input type.
Source§impl From<PositiveDecimal> for NonNegativeDecimal
impl From<PositiveDecimal> for NonNegativeDecimal
Source§fn from(value: PositiveDecimal) -> Self
fn from(value: PositiveDecimal) -> Self
Converts to this type from the input type.
Source§impl From<Ratio> for NonNegativeDecimal
impl From<Ratio> for NonNegativeDecimal
Source§impl PartialEq for NonNegativeDecimal
impl PartialEq for NonNegativeDecimal
Source§fn eq(&self, other: &NonNegativeDecimal) -> bool
fn eq(&self, other: &NonNegativeDecimal) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialOrd for NonNegativeDecimal
impl PartialOrd for NonNegativeDecimal
Source§impl Serialize for NonNegativeDecimal
impl Serialize for NonNegativeDecimal
impl StructuralPartialEq for NonNegativeDecimal
Auto Trait Implementations§
impl Freeze for NonNegativeDecimal
impl RefUnwindSafe for NonNegativeDecimal
impl Send for NonNegativeDecimal
impl Sync for NonNegativeDecimal
impl Unpin for NonNegativeDecimal
impl UnsafeUnpin for NonNegativeDecimal
impl UnwindSafe for NonNegativeDecimal
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