Trait pushgen::traits::Sum

source ·
pub trait Sum<A = Self>: Sized {
    // Required method
    fn sum<G>(gen: G) -> Self
       where G: Generator<Output = A>;
}
Expand description

Trait to represent types that can be created by summing up a generator.

The trait is used to implement the sum() method on generators. Types which implement this trait can be generated by the sum() method. This trait is generally interacted with via GeneratorExt::sum.

Required Methods§

source

fn sum<G>(gen: G) -> Selfwhere G: Generator<Output = A>,

Calculate the sum from a given generator.

Implementations on Foreign Types§

source§

impl Sum<Wrapping<i16>> for Wrapping<i16>

source§

fn sum<G: Generator<Output = Self>>(gen: G) -> Self

source§

impl<'a> Sum<&'a u128> for u128

source§

fn sum<G: Generator<Output = &'a Self>>(gen: G) -> Self

source§

impl Sum<i64> for i64

source§

fn sum<G: Generator<Output = Self>>(gen: G) -> Self

source§

impl Sum<Wrapping<i8>> for Wrapping<i8>

source§

fn sum<G: Generator<Output = Self>>(gen: G) -> Self

source§

impl Sum<u8> for u8

source§

fn sum<G: Generator<Output = Self>>(gen: G) -> Self

source§

impl<'a> Sum<&'a i64> for i64

source§

fn sum<G: Generator<Output = &'a Self>>(gen: G) -> Self

source§

impl<'a> Sum<&'a usize> for usize

source§

fn sum<G: Generator<Output = &'a Self>>(gen: G) -> Self

source§

impl<'a> Sum<&'a i128> for i128

source§

fn sum<G: Generator<Output = &'a Self>>(gen: G) -> Self

source§

impl Sum<Wrapping<i32>> for Wrapping<i32>

source§

fn sum<G: Generator<Output = Self>>(gen: G) -> Self

source§

impl<'a> Sum<&'a Wrapping<isize>> for Wrapping<isize>

source§

fn sum<G: Generator<Output = &'a Self>>(gen: G) -> Self

source§

impl Sum<f32> for f32

source§

fn sum<G: Generator<Output = Self>>(gen: G) -> Self

source§

impl<'a> Sum<&'a Wrapping<u16>> for Wrapping<u16>

source§

fn sum<G: Generator<Output = &'a Self>>(gen: G) -> Self

source§

impl<'a> Sum<&'a f64> for f64

source§

fn sum<G: Generator<Output = &'a Self>>(gen: G) -> Self

source§

impl Sum<Wrapping<u32>> for Wrapping<u32>

source§

fn sum<G: Generator<Output = Self>>(gen: G) -> Self

source§

impl Sum<Wrapping<isize>> for Wrapping<isize>

source§

fn sum<G: Generator<Output = Self>>(gen: G) -> Self

source§

impl Sum<isize> for isize

source§

fn sum<G: Generator<Output = Self>>(gen: G) -> Self

source§

impl<'a> Sum<&'a i16> for i16

source§

fn sum<G: Generator<Output = &'a Self>>(gen: G) -> Self

source§

impl Sum<Wrapping<usize>> for Wrapping<usize>

source§

fn sum<G: Generator<Output = Self>>(gen: G) -> Self

source§

impl<'a> Sum<&'a Wrapping<usize>> for Wrapping<usize>

source§

fn sum<G: Generator<Output = &'a Self>>(gen: G) -> Self

source§

impl<'a> Sum<&'a Wrapping<u64>> for Wrapping<u64>

source§

fn sum<G: Generator<Output = &'a Self>>(gen: G) -> Self

source§

impl<'a> Sum<&'a Wrapping<i128>> for Wrapping<i128>

source§

fn sum<G: Generator<Output = &'a Self>>(gen: G) -> Self

source§

impl Sum<Wrapping<u16>> for Wrapping<u16>

source§

fn sum<G: Generator<Output = Self>>(gen: G) -> Self

source§

impl Sum<u32> for u32

source§

fn sum<G: Generator<Output = Self>>(gen: G) -> Self

source§

impl Sum<i32> for i32

source§

fn sum<G: Generator<Output = Self>>(gen: G) -> Self

source§

impl Sum<usize> for usize

source§

fn sum<G: Generator<Output = Self>>(gen: G) -> Self

source§

impl Sum<u128> for u128

source§

fn sum<G: Generator<Output = Self>>(gen: G) -> Self

source§

impl<'a> Sum<&'a i32> for i32

source§

fn sum<G: Generator<Output = &'a Self>>(gen: G) -> Self

source§

impl Sum<Wrapping<u128>> for Wrapping<u128>

source§

fn sum<G: Generator<Output = Self>>(gen: G) -> Self

source§

impl Sum<i16> for i16

source§

fn sum<G: Generator<Output = Self>>(gen: G) -> Self

source§

impl<'a> Sum<&'a Wrapping<u32>> for Wrapping<u32>

source§

fn sum<G: Generator<Output = &'a Self>>(gen: G) -> Self

source§

impl<'a> Sum<&'a u16> for u16

source§

fn sum<G: Generator<Output = &'a Self>>(gen: G) -> Self

source§

impl Sum<Wrapping<i128>> for Wrapping<i128>

source§

fn sum<G: Generator<Output = Self>>(gen: G) -> Self

source§

impl<'a> Sum<&'a u64> for u64

source§

fn sum<G: Generator<Output = &'a Self>>(gen: G) -> Self

source§

impl Sum<Wrapping<u8>> for Wrapping<u8>

source§

fn sum<G: Generator<Output = Self>>(gen: G) -> Self

source§

impl<'a> Sum<&'a isize> for isize

source§

fn sum<G: Generator<Output = &'a Self>>(gen: G) -> Self

source§

impl<'a> Sum<&'a u32> for u32

source§

fn sum<G: Generator<Output = &'a Self>>(gen: G) -> Self

source§

impl<'a> Sum<&'a u8> for u8

source§

fn sum<G: Generator<Output = &'a Self>>(gen: G) -> Self

source§

impl<'a> Sum<&'a Wrapping<u8>> for Wrapping<u8>

source§

fn sum<G: Generator<Output = &'a Self>>(gen: G) -> Self

source§

impl Sum<Wrapping<i64>> for Wrapping<i64>

source§

fn sum<G: Generator<Output = Self>>(gen: G) -> Self

source§

impl<'a> Sum<&'a Wrapping<i16>> for Wrapping<i16>

source§

fn sum<G: Generator<Output = &'a Self>>(gen: G) -> Self

source§

impl Sum<f64> for f64

source§

fn sum<G: Generator<Output = Self>>(gen: G) -> Self

source§

impl<'a> Sum<&'a Wrapping<u128>> for Wrapping<u128>

source§

fn sum<G: Generator<Output = &'a Self>>(gen: G) -> Self

source§

impl<'a> Sum<&'a Wrapping<i8>> for Wrapping<i8>

source§

fn sum<G: Generator<Output = &'a Self>>(gen: G) -> Self

source§

impl<'a> Sum<&'a i8> for i8

source§

fn sum<G: Generator<Output = &'a Self>>(gen: G) -> Self

source§

impl<'a> Sum<&'a f32> for f32

source§

fn sum<G: Generator<Output = &'a Self>>(gen: G) -> Self

source§

impl<'a> Sum<&'a Wrapping<i64>> for Wrapping<i64>

source§

fn sum<G: Generator<Output = &'a Self>>(gen: G) -> Self

source§

impl Sum<i8> for i8

source§

fn sum<G: Generator<Output = Self>>(gen: G) -> Self

source§

impl Sum<Wrapping<u64>> for Wrapping<u64>

source§

fn sum<G: Generator<Output = Self>>(gen: G) -> Self

source§

impl<'a> Sum<&'a Wrapping<i32>> for Wrapping<i32>

source§

fn sum<G: Generator<Output = &'a Self>>(gen: G) -> Self

source§

impl Sum<u16> for u16

source§

fn sum<G: Generator<Output = Self>>(gen: G) -> Self

source§

impl Sum<i128> for i128

source§

fn sum<G: Generator<Output = Self>>(gen: G) -> Self

source§

impl Sum<u64> for u64

source§

fn sum<G: Generator<Output = Self>>(gen: G) -> Self

Implementors§