/// Creates a new stream which calls a closure on each element and uses
/// that as the value.
///
/// # Examples
///
/// ```
/// # use reactive_rs::*;
/// let stream = SimpleBroadcast::<String>::new();
/// let contains_foo = stream.map(|s| s.contains("foo"));
/// ```
///
/// # Notes
///
/// - The context is passed down unchanged.
/// - The closure receives its argument by reference.
/// - The return value is a `Stream` object (context type is unchanged;
///   value type is the return type of the closure).
Creates a new stream which calls a closure on each element and uses
that as the value.
Creates a new stream which calls a closure on each element and uses that as the value .
fn map<F, T>(self, func: F) -> Map<Self, NoContext<F>>
    where
        F: 'a + FnMut(&Self::Item) -> T,
    {
        Map { stream: self, func: NoContext(func) }
    }
fn map < F , T > ( self , func : F ) -> Map < Self , NoContext < F > > where F : ' a + FnMut ( & Self :: Item ) -> T , { Map { stream : self , func : NoContext ( func ) } }
Creates a new stream which calls a closure on each element and uses
that as the value.
Creates a new stream which calls a closure on each element and uses that as the value .
self
func
F
examples
None
use reactive_rs::*;
let stream = SimpleBroadcast::::new();
let contains_foo = stream.map(|s| s.contains("foo"));
```
let stream = SimpleBroadcast :::: new () ; let contains_foo = stream . map ( |s| s . contains ( " foo " )) ; ` ` `
notes
The context is passed down unchanged.
The closure receives its argument by reference.
The return value is a `Stream` object (context type is unchanged;
value type is the return type of the closure).
The context is passed down unchanged . The closure receives its argument by reference . The return value is a ` Stream ` object ( context type is unchanged ; value type is the return type of the closure ) .