fn filter<F>(self, func: F) -> Filter<Self, NoContext<F>>
    where
        F: 'a + FnMut(&Self::Item) -> bool,
    {
        Filter { stream: self, func: NoContext(func) }
    }
/// Creates a stream which uses a closure to determine if an element should be
/// yielded.
///
/// The closure must return `true` or `false` and is called on each element of the
/// original stream. If `true` is returned, the element is passed downstream.
///
/// # Examples
///
/// ```
/// # use reactive_rs::*;
/// let stream = SimpleBroadcast::<Vec<i32>>::new();
/// let non_empty = stream.filter(|v| !v.is_empty());
/// ```
///
/// # Notes
///
/// - The context is 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).
Creates a stream which uses a closure to determine if an element should be
yielded.

The closure must return `true` or `false` and is called on each element of the
original stream. If `true` is returned, the element is passed downstream.
Creates a stream which uses a closure to determine if an element should be yielded . The closure must return ` true ` or ` false ` and is called on each element of the original stream . If ` true ` is returned the element is passed downstream .
fn filter<F>(self, func: F) -> Filter<Self, NoContext<F>>
    where
        F: 'a + FnMut(&Self::Item) -> bool,
    {
        Filter { stream: self, func: NoContext(func) }
    }
fn filter < F > ( self , func : F ) -> Filter < Self , NoContext < F > > where F : ' a + FnMut ( & Self :: Item ) -> bool , { Filter { stream : self , func : NoContext ( func ) } }
Creates a stream which uses a closure to determine if an element should be
yielded.
Creates a stream which uses a closure to determine if an element should be yielded .
self
func
F
self
func
F
examples
None
use reactive_rs::*;
let stream = SimpleBroadcast::>::new();
let non_empty = stream.filter(|v| !v.is_empty());
```
let stream = SimpleBroadcast :: > :: new () ; let non_empty = stream . filter ( |v| !v . is_empty () ) ; ` ` `
notes
The context is 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).
The context is 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 ) .