pub struct Quantity(/* private fields */);
Expand description
An arbitrary precision unsigned integer.
Implementations§
Source§impl Quantity
impl Quantity
Sourcepub fn checked_sub(&self, other: &Quantity) -> Option<Quantity>
pub fn checked_sub(&self, other: &Quantity) -> Option<Quantity>
Subtracts two numbers, checking for underflow. If underflow happens, None
is returned.
Sourcepub fn checked_div(&self, other: &Quantity) -> Option<Quantity>
pub fn checked_div(&self, other: &Quantity) -> Option<Quantity>
Divides two numbers, checking for underflow, overflow and division by zero. If any of that
happens, None
is returned.
Trait Implementations§
Source§impl<'a> AddAssign<&'a Quantity> for Quantity
impl<'a> AddAssign<&'a Quantity> for Quantity
Source§fn add_assign(&mut self, other: &Quantity)
fn add_assign(&mut self, other: &Quantity)
Performs the
+=
operation. Read moreSource§impl AddAssign<u64> for Quantity
impl AddAssign<u64> for Quantity
Source§fn add_assign(&mut self, other: u64)
fn add_assign(&mut self, other: u64)
Performs the
+=
operation. Read moreSource§impl AddAssign for Quantity
impl AddAssign for Quantity
Source§fn add_assign(&mut self, other: Quantity)
fn add_assign(&mut self, other: Quantity)
Performs the
+=
operation. Read moreSource§impl Decode for Quantity
impl Decode for Quantity
Source§fn try_default() -> Result<Self, DecodeError>
fn try_default() -> Result<Self, DecodeError>
Try to decode from a missing/null/undefined value.
Source§fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>
fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>
Try to decode from a given CBOR value.
§fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>where
Self: Sized,
fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>where
Self: Sized,
Try to decode from a given CBOR value, calling
try_default
in case the value is null or
undefined.Source§impl<'a> MulAssign<&'a Quantity> for Quantity
impl<'a> MulAssign<&'a Quantity> for Quantity
Source§fn mul_assign(&mut self, rhs: &Quantity)
fn mul_assign(&mut self, rhs: &Quantity)
Performs the
*=
operation. Read moreSource§impl MulAssign<u64> for Quantity
impl MulAssign<u64> for Quantity
Source§fn mul_assign(&mut self, other: u64)
fn mul_assign(&mut self, other: u64)
Performs the
*=
operation. Read moreSource§impl MulAssign for Quantity
impl MulAssign for Quantity
Source§fn mul_assign(&mut self, rhs: Quantity)
fn mul_assign(&mut self, rhs: Quantity)
Performs the
*=
operation. Read moreSource§impl Ord for Quantity
impl Ord for Quantity
Source§impl PartialOrd for Quantity
impl PartialOrd for Quantity
impl Eq for Quantity
impl StructuralPartialEq for Quantity
Auto Trait Implementations§
impl Freeze for Quantity
impl RefUnwindSafe for Quantity
impl Send for Quantity
impl Sync for Quantity
impl Unpin for Quantity
impl UnwindSafe for Quantity
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.