fn fold<O, F>(self, initial: O, func: F) -> Fold<Self, F, O>
        where Self: Sized,
              F: FnMut(O, Self::Item) -> O
    {
        Fold::new(self, initial, func)
    }
/// A stream adaptor that applies a function, producing a single, final
/// value. `fold()` takes two arguments: an initial value, and a closure
/// with two arguments: an 'accumulator', and an element. It returns the
/// value that the accumulator should have for the next iteration.
///
/// The initial value is the value the accumulator will have on the first
/// call. After applying this closure to every element of the iterator,
/// `fold()` returns the accumulator.
///
/// This operation is sometimes called 'reduce' or 'inject'. Folding is
/// useful whenever you have a collection of something, and want to produce
/// a single value from it.
///
/// # Examples
///
/// ```
/// use asyncplify::*; let mut v = 0;
///
/// (0..10)
///     .into_stream()
///     .fold(0, |o, i| o + i)
///     .subscribe_action(|x| v = x);
///
/// assert!(v == 45, "v = {}", v);
/// ```
A stream adaptor that applies a function, producing a single, final
value. `fold()` takes two arguments: an initial value, and a closure
with two arguments: an 'accumulator', and an element. It returns the
value that the accumulator should have for the next iteration.

The initial value is the value the accumulator will have on the first
call. After applying this closure to every element of the iterator,
`fold()` returns the accumulator.

This operation is sometimes called 'reduce' or 'inject'. Folding is
useful whenever you have a collection of something, and want to produce
a single value from it.
A stream adaptor that applies a function producing a single final value . ` fold () ` takes two arguments : an initial value and a closure with two arguments : an ' accumulator ' and an element . It returns the value that the accumulator should have for the next iteration . The initial value is the value the accumulator will have on the first call . After applying this closure to every element of the iterator ` fold () ` returns the accumulator . This operation is sometimes called ' reduce ' or ' inject ' . Folding is useful whenever you have a collection of something and want to produce a single value from it .
fn fold<O, F>(self, initial: O, func: F) -> Fold<Self, F, O>
        where Self: Sized,
              F: FnMut(O, Self::Item) -> O
    {
        Fold::new(self, initial, func)
    }
fn fold < O , F > ( self , initial : O , func : F ) -> Fold < Self , F , O > where Self : Sized , F : FnMut ( O , Self :: Item ) -> O { Fold :: new ( self , initial , func ) }
A stream adaptor that applies a function, producing a single, final
value.
A stream adaptor that applies a function producing a single final value .
self
initial
O
func
F
self
initial
O
func
F
examples
```
use asyncplify::*; let mut v = 0.




` ` ` use asyncplify :: * ; let mut v = 0 .