fn scan<O, F>(self, initial: O, func: F) -> Scan<Self, F, O>
        where Self: Sized,
              F: FnMut(O, Self::Item) -> O,
              O: Clone
    {
        Scan::new(self, initial, func)
    }
/// A stream adaptor similar to `fold()` that holds internal state and
/// produces a new stream. `scan()` takes two arguments: an initial value
/// which seeds the internal state, and a closure with two arguments, the
/// first being a mutable reference to the internal state and the second an
/// stream element. The closure can assign to the internal state to share
/// state between iterations.
///
/// On iteration, the closure will be applied to each element of the stream
/// and the return value from the closure, an Option, is emitted by the
/// stream.
///
/// # Examples
///
/// ```
/// use asyncplify::*;
///
/// let vec = (0..6)
///     .into_stream()
///     .scan(0, |o, i| o + i)
///     .into_vec();
///
/// assert!(vec == [0, 1, 3, 6, 10, 15], "vec = {:?}", vec);
/// ```
A stream adaptor similar to `fold()` that holds internal state and
produces a new stream. `scan()` takes two arguments: an initial value
which seeds the internal state, and a closure with two arguments, the
first being a mutable reference to the internal state and the second an
stream element. The closure can assign to the internal state to share
state between iterations.

On iteration, the closure will be applied to each element of the stream
and the return value from the closure, an Option, is emitted by the
stream.
A stream adaptor similar to ` fold () ` that holds internal state and produces a new stream . ` scan () ` takes two arguments : an initial value which seeds the internal state and a closure with two arguments the first being a mutable reference to the internal state and the second an stream element . The closure can assign to the internal state to share state between iterations . On iteration the closure will be applied to each element of the stream and the return value from the closure an Option is emitted by the stream .
fn scan<O, F>(self, initial: O, func: F) -> Scan<Self, F, O>
        where Self: Sized,
              F: FnMut(O, Self::Item) -> O,
              O: Clone
    {
        Scan::new(self, initial, func)
    }
fn scan < O , F > ( self , initial : O , func : F ) -> Scan < Self , F , O > where Self : Sized , F : FnMut ( O , Self :: Item ) -> O , O : Clone { Scan :: new ( self , initial , func ) }
A stream adaptor similar to `fold()` that holds internal state and
produces a new stream.
A stream adaptor similar to ` fold () ` that holds internal state and produces a new stream .
self
initial
O
func
F
self
initial
O
func
F
examples
```
use asyncplify::*.




` ` ` use asyncplify :: * .