[][src]Trait async_std::stream::Sum

pub trait Sum<A = Self>: Sized {
    fn sum<S, F>(stream: S) -> F
    where
        S: Stream<Item = A>,
        F: Future<Output = Self>
; }
This is supported on unstable only.

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

This trait is used to implement the sum method on streams. Types which implement the trait can be generated by the sum method. Like FromStream this trait should rarely be called directly and instead interacted with through Stream::sum.

Required methods

fn sum<S, F>(stream: S) -> F where
    S: Stream<Item = A>,
    F: Future<Output = Self>, 

This is supported on unstable only.

Method which takes a stream and generates Self from the elements by "summing up" the items.

Loading content...

Implementors

Loading content...