pub fn filter<F>(&self, pred: F) -> Self
  where
    F: 'a + Fn(&Sig) -> bool,
  {
    let filtered = Stream::new();
    let filtered_ = filtered.new_same();

    self.observe(move |sig| {
      if pred(sig) {
        filtered_.send(sig);
      }
    });

    filtered
  }
/// Filter the signals flowing out of a stream with a predicate.
Filter the signals flowing out of a stream with a predicate.
Filter the signals flowing out of a stream with a predicate .
pub fn filter<F>(&self, pred: F) -> Self
  where
    F: 'a + Fn(&Sig) -> bool,
  {
    let filtered = Stream::new();
    let filtered_ = filtered.new_same();
    self.observe(move |sig| {
      if pred(sig) {
        filtered_.send(sig);
      }
    });
    filtered
  }
pub fn filter < F > ( & self , pred : F ) -> Self where F : ' a + Fn ( & Sig ) -> bool , { let filtered = Stream :: new ( ) ; let filtered_ = filtered . new_same ( ) ; self . observe ( move | sig | { if pred ( sig ) { filtered_ . send ( sig ) ; } } ) ; filtered }
Filter the signals flowing out of a stream with a predicate.
Filter the signals flowing out of a stream with a predicate .
&self
pred
F
&self
pred
F