Struct oasis_core_runtime::common::quantity::Quantity
source · 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 PartialEq for Quantity
impl PartialEq for Quantity
source§impl PartialOrd for Quantity
impl PartialOrd for Quantity
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl 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,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§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.