pub struct Filter<F> { /* private fields */ }Expand description
Filter operator: keeps inputs that satisfy the predicate.
Example
use pulse_ops::{Filter, FilterFn};
let filter = Filter::new(FilterFn::new(|v: &serde_json::Value| v.get("ok").and_then(|x| x.as_bool()).unwrap_or(false)));Implementations§
Trait Implementations§
Source§impl<F> Operator for Filter<F>
impl<F> Operator for Filter<F>
fn on_element<'life0, 'life1, 'async_trait>(
&'life0 mut self,
ctx: &'life1 mut dyn Context,
rec: Record,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn on_watermark<'life0, 'life1, 'async_trait>(
&'life0 mut self,
_ctx: &'life1 mut dyn Context,
_wm: Watermark,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn on_timer<'life0, 'life1, 'async_trait>(
&'life0 mut self,
_ctx: &'life1 mut dyn Context,
_when: EventTime,
_key: Option<Vec<u8>>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Auto Trait Implementations§
impl<F> Freeze for Filter<F>where
F: Freeze,
impl<F> RefUnwindSafe for Filter<F>where
F: RefUnwindSafe,
impl<F> Send for Filter<F>where
F: Send,
impl<F> Sync for Filter<F>where
F: Sync,
impl<F> Unpin for Filter<F>where
F: Unpin,
impl<F> UnwindSafe for Filter<F>where
F: UnwindSafe,
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