pub struct Extract { /* private fields */ }
Implementations§
Source§impl Extract
impl Extract
Sourcepub fn set_export_path(self, export: bool) -> Self
pub fn set_export_path(self, export: bool) -> Self
Sets whether matched path should be exported with data Output data will be enriched with the path from were the data were extracted
if path is not exported extraction can be a bit faster
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 for data extraction
§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 extract = strategy::Extract::new();
let matcher = matcher::Simple::new(r#"{"list"}[]"#).unwrap();
let mut extract = strategy::Extract::new();
extract.add_matcher(
Box::new(matcher),
None,
);
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Extract
impl !RefUnwindSafe for Extract
impl Send for Extract
impl !Sync for Extract
impl Unpin for Extract
impl !UnwindSafe for Extract
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