pub struct Filter { /* private fields */ }
Expand description
Processes data from input and remove matched parts (and keeps the json valid)
Implementations§
Source§impl Filter
impl Filter
Sourcepub fn add_matcher(
&mut self,
matcher: Box<dyn Matcher>,
handler: Option<Arc<Mutex<dyn Handler>>>,
)
pub fn add_matcher( &mut self, matcher: Box<dyn Matcher>, handler: Option<Arc<Mutex<dyn Handler>>>, )
Adds new matcher into filtering
§Arguments
matcher
- matcher which matches the pathhandler
- optinal handler to be used to process data
§Example
use streamson_lib::{strategy, matcher};
use std::sync::{Arc, Mutex};
let mut filter = strategy::Filter::new();
let matcher = matcher::Simple::new(r#"{"list"}[]"#).unwrap();
filter.add_matcher(
Box::new(matcher),
None,
);
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Filter
impl !RefUnwindSafe for Filter
impl Send for Filter
impl !Sync for Filter
impl Unpin for Filter
impl !UnwindSafe for Filter
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