Skip to main content

CheckedSum

Trait CheckedSum 

Source
pub trait CheckedSum<A>: Sized {
    // Required method
    fn checked_sum(self) -> Result<A>;
}
Expand description

Extension trait for providing checked Iterator::sum-like functionality.

Required Methods§

Source

fn checked_sum(self) -> Result<A>

Iterate over the values of this type, computing a checked sum.

§Errors

Returns Error::Length on overflow.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<T> CheckedSum<usize> for T
where T: IntoIterator<Item = usize>,