pub trait Sum<A = Self> {
fn sum<I>(iter: I) -> Self
where
I: Iterator<Item = A>;
}
Expand description
Trait to represent types that can be created by summing up an iterator.
This trait is used to implement Iterator::sum()
. Types which implement
this trait can be generated by using the sum()
method on an iterator.
Like FromIterator
, this trait should rarely be called directly.
Method which takes an iterator and generates Self
from the elements by
“summing up” the items.
impl Sum<LittleEndian<f32>> for LittleEndian<f32>
impl Sum<LittleEndian<f64>> for LittleEndian<f64>
impl Sum<LittleEndian<i16>> for LittleEndian<i16>
impl Sum<LittleEndian<i32>> for LittleEndian<i32>
impl Sum<LittleEndian<i64>> for LittleEndian<i64>
impl Sum<LittleEndian<u16>> for LittleEndian<u16>
impl Sum<LittleEndian<u32>> for LittleEndian<u32>
impl Sum<LittleEndian<u64>> for LittleEndian<u64>
impl Sum<NativeEndian<f32>> for NativeEndian<f32>
impl Sum<NativeEndian<f64>> for NativeEndian<f64>
impl Sum<NativeEndian<i16>> for NativeEndian<i16>
impl Sum<NativeEndian<i32>> for NativeEndian<i32>
impl Sum<NativeEndian<i64>> for NativeEndian<i64>
impl Sum<NativeEndian<u16>> for NativeEndian<u16>
impl Sum<NativeEndian<u32>> for NativeEndian<u32>
impl Sum<NativeEndian<u64>> for NativeEndian<u64>