/// Creates a stream that both filters and maps.
///
/// The closure must return an `Option<T>`. If it returns `Some(element)`, then
/// that element is returned; otherwise it is skipped.
///
/// # Examples
///
/// ```
/// # use reactive_rs::*;
/// let stream = SimpleBroadcast::<String>::new();
/// let valid_ints = stream.filter_map(|s| s.parse::<i64>().ok());
/// ```
///
/// # 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 is `T` if the return type of the closure is `Option<T>`).
Creates a stream that both filters and maps.
The closure must return an `Option`. If it returns `Some(element)`, then
that element is returned; otherwise it is skipped.
Creates a stream that both filters and maps . The closure must return an ` Option ` . If it returns ` Some ( element ) ` then that element is returned ; otherwise it is skipped .
fn filter_map<F, T>(self, func: F) -> FilterMap<Self, NoContext<F>>
    where
        F: 'a + FnMut(&Self::Item) -> Option<T>,
    {
        FilterMap { stream: self, func: NoContext(func) }
    }
fn filter_map < F , T > ( self , func : F ) -> FilterMap < Self , NoContext < F > > where F : ' a + FnMut ( & Self :: Item ) -> Option < T > , { FilterMap { stream : self , func : NoContext ( func ) } }
Creates a stream that both filters and maps.
Creates a stream that both filters and maps .
self
func
F
examples
None
use reactive_rs::*;
let stream = SimpleBroadcast::::new();
let valid_ints = stream.filter_map(|s| s.parse::().ok());
```
let stream = SimpleBroadcast :::: new () ; let valid_ints = stream . filter_map ( |s| s . parse :: () . ok () ) ; ` ` `
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 is `T` if the return type of the closure is `Option`).
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 is ` T ` if the return type of the closure is ` Option ` ) .