pub struct Qty {
pub value: i64,
pub scale: Scale,
}
Fields§
§value: i64
§scale: Scale
Implementations§
Source§impl Qty
impl Qty
pub fn lowest_positive() -> Qty
pub fn is_zero(&self) -> bool
pub fn calc_percentage(&self, base100: &Self) -> f64
pub fn adjust_scale(&self) -> Qty
Trait Implementations§
Source§impl<'b> AddAssign<&'b Qty> for Qty
impl<'b> AddAssign<&'b Qty> for Qty
Source§fn add_assign(&mut self, other: &'b Self)
fn add_assign(&mut self, other: &'b Self)
Performs the
+=
operation. Read moreSource§impl Ord for Qty
impl Ord for Qty
Source§impl PartialOrd for Qty
impl PartialOrd for Qty
Source§impl<'b> SubAssign<&'b Qty> for Qty
impl<'b> SubAssign<&'b Qty> for Qty
Source§fn sub_assign(&mut self, other: &'b Self)
fn sub_assign(&mut self, other: &'b Self)
Performs the
-=
operation. Read moreimpl Eq for Qty
impl StructuralPartialEq for Qty
Auto Trait Implementations§
impl Freeze for Qty
impl RefUnwindSafe for Qty
impl Send for Qty
impl Sync for Qty
impl Unpin for Qty
impl UnwindSafe for Qty
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more