[−][src]Struct bookkeeping::Sum
Represents amounts of any number of units.
Implementations
impl<T: Metadata> Sum<T>
[src]
pub fn new() -> Self
[src]
Creates an empty sum.
pub fn of(unit: &Rc<Unit<T>>, amount: u64) -> Self
[src]
Creates a sum with an amount of a single unit.
pub fn unit(self, unit: &Rc<Unit<T>>, amount: u64) -> Self
[src]
Sets the amount of a unit in a sum.
Trait Implementations
impl<T: Metadata, '_> Add<&'_ Sum<T>> for Balance<T>
[src]
type Output = Self
The resulting type after applying the +
operator.
pub fn add(self, sum: &Sum<T>) -> Self::Output
[src]
impl<T: Metadata, '_> AddAssign<&'_ Sum<T>> for Balance<T>
[src]
pub fn add_assign(&mut self, sum: &Sum<T>)
[src]
impl<T: Clone + Metadata> Clone for Sum<T>
[src]
impl<T: Metadata> Debug for Sum<T>
[src]
impl<T: PartialEq + Metadata> PartialEq<Sum<T>> for Sum<T>
[src]
impl<T: Metadata> StructuralPartialEq for Sum<T>
[src]
impl<T: Metadata, '_> Sub<&'_ Sum<T>> for Balance<T>
[src]
type Output = Self
The resulting type after applying the -
operator.
pub fn sub(self, sum: &Sum<T>) -> Self::Output
[src]
impl<T: Metadata, '_> SubAssign<&'_ Sum<T>> for Balance<T>
[src]
pub fn sub_assign(&mut self, sum: &Sum<T>)
[src]
Auto Trait Implementations
impl<T> !RefUnwindSafe for Sum<T>
impl<T> !Send for Sum<T>
impl<T> !Sync for Sum<T>
impl<T> Unpin for Sum<T>
impl<T> !UnwindSafe for Sum<T>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,