Trait cgats::PartialSum

source ·
pub trait PartialSum<'a, T>: 'a + PartialAdd<Self, Output = T> {
    // Required method
    fn partial_sum<I: IntoIterator<Item = &'a Self>>(
        iter: I
    ) -> Option<Self::Output>;
}
Expand description

Trait to sum an iterator of values that may or may not be compatible

Required Methods§

source

fn partial_sum<I: IntoIterator<Item = &'a Self>>( iter: I ) -> Option<Self::Output>

Try to sum the values in the iterator

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<'a, T> PartialSum<'a, T> for T
where T: Clone + PartialAdd<Self, Output = Self> + 'a,