/// Do something with each element of a stream, passing the value on.
///
/// The closure will only be called if the stream is actually
/// subscribed to (just calling `inspect()` does nothing on its own).
///
/// # Examples
///
/// ```
/// # use reactive_rs::*;
/// let stream = SimpleBroadcast::<String>::new();
/// let stream = stream.inspect(|x| println!("{:?}", x));
/// ```
///
/// # Notes
///
/// - Both context/value are passed down unchanged.
/// - The closure receives its argument by reference.
/// - The return value is a `Stream` object (same context type and
///   value type as the original stream).
Do something with each element of a stream, passing the value on.
The closure will only be called if the stream is actually
subscribed to (just calling `inspect()` does nothing on its own).
Do something with each element of a stream passing the value on . The closure will only be called if the stream is actually subscribed to ( just calling ` inspect () ` does nothing on its own ) .
fn inspect<F>(self, func: F) -> Inspect<Self, NoContext<F>>
    where
        F: 'a + FnMut(&Self::Item),
    {
        Inspect { stream: self, func: NoContext(func) }
    }
fn inspect < F > ( self , func : F ) -> Inspect < Self , NoContext < F > > where F : ' a + FnMut ( & Self :: Item ) , { Inspect { stream : self , func : NoContext ( func ) } }
Do something with each element of a stream, passing the value on.
Do something with each element of a stream passing the value on .
self
func
F
examples
None
use reactive_rs::*;
let stream = SimpleBroadcast::::new();
let stream = stream.inspect(|x| println!("{:?}", x));
```
let stream = SimpleBroadcast :::: new () ; let stream = stream . inspect ( |x| println! ( " { : ? } " x )) ; ` ` `
notes
Both context/value are passed down unchanged.
The closure receives its argument by reference.
The return value is a `Stream` object (same context type and
value type as the original stream).
Both context / value are passed down unchanged . The closure receives its argument by reference . The return value is a ` Stream ` object ( same context type and value type as the original stream ) .