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

Implementors§

source§

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