pub struct PositiveDecimal(/* private fields */);Expand description
Decimal constrained to x > 0.
Implementations§
Source§impl PositiveDecimal
impl PositiveDecimal
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 PositiveDecimal
impl AsRef<Decimal> for PositiveDecimal
Source§impl Clone for PositiveDecimal
impl Clone for PositiveDecimal
Source§fn clone(&self) -> PositiveDecimal
fn clone(&self) -> PositiveDecimal
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 PositiveDecimal
Source§impl Debug for PositiveDecimal
impl Debug for PositiveDecimal
Source§impl Decimal128Mantissa for PositiveDecimal
impl Decimal128Mantissa for PositiveDecimal
Source§impl<'de> Deserialize<'de> for PositiveDecimal
impl<'de> Deserialize<'de> for PositiveDecimal
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 PositiveDecimal
impl Display for PositiveDecimal
impl Eq for PositiveDecimal
Source§impl From<PositiveDecimal> for Decimal
impl From<PositiveDecimal> for Decimal
Source§fn from(value: PositiveDecimal) -> Self
fn from(value: PositiveDecimal) -> 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 PartialEq for PositiveDecimal
impl PartialEq for PositiveDecimal
Source§fn eq(&self, other: &PositiveDecimal) -> bool
fn eq(&self, other: &PositiveDecimal) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialOrd for PositiveDecimal
impl PartialOrd for PositiveDecimal
Source§impl Serialize for PositiveDecimal
impl Serialize for PositiveDecimal
impl StructuralPartialEq for PositiveDecimal
Auto Trait Implementations§
impl Freeze for PositiveDecimal
impl RefUnwindSafe for PositiveDecimal
impl Send for PositiveDecimal
impl Sync for PositiveDecimal
impl Unpin for PositiveDecimal
impl UnsafeUnpin for PositiveDecimal
impl UnwindSafe for PositiveDecimal
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