bitcoin_units::amount

Trait CheckedSum

source
pub trait CheckedSum<R>: SumSeal<R> {
    // Required method
    fn checked_sum(self) -> Option<R>;
}
Expand description

Calculates the sum over the iterator using checked arithmetic.

Required Methods§

source

fn checked_sum(self) -> Option<R>

Calculates the sum over the iterator using checked arithmetic. If an over or underflow would happen it returns None.

Implementors§

source§

impl<T> CheckedSum<Amount> for T
where T: Iterator<Item = Amount>,

source§

impl<T> CheckedSum<SignedAmount> for T
where T: Iterator<Item = SignedAmount>,