[][src]Struct bookkeeping::Sum

pub struct Sum<T: Metadata>(_);

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.

impl<T: Metadata, '_> AddAssign<&'_ Sum<T>> for Balance<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.

impl<T: Metadata, '_> SubAssign<&'_ Sum<T>> for Balance<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]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.