pub struct Filter<A, B>where
A: 'static,
B: 'static,{ /* private fields */ }
Expand description
Apply a function, returning an Option to allow filtering samples.
Inputs
in
: Input
Outputs
out
: Filtered outputs
Usage
use futuresdr::blocks::Filter;
use futuresdr::runtime::Flowgraph;
let mut fg = Flowgraph::new();
// Remove samples above 1.0
let filter = fg.add_block(Filter::<f32, f32>::new(|i| {
if *i < 1.0 {
Some(*i)
} else {
None
}
}));
Implementations§
Auto Trait Implementations§
impl<A, B> !RefUnwindSafe for Filter<A, B>
impl<A, B> Send for Filter<A, B>
impl<A, B> !Sync for Filter<A, B>
impl<A, B> Unpin for Filter<A, B>
impl<A, B> !UnwindSafe for Filter<A, B>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more