pub struct Regex { /* private fields */ }
Expand description
Regex path matcher
It uses regex to match path
§Examples
use streamson_lib::{handler, strategy::{self, Strategy}, matcher};
use std::{io, str::FromStr, sync::{Arc, Mutex}};
let handler = Arc::new(Mutex::new(handler::Output::new(io::stdout())));
let matcher = matcher::Regex::from_str(r#"\{"[Uu]ser"\}\[\]"#).unwrap();
let mut trigger = strategy::Trigger::new();
trigger.add_matcher(
Box::new(matcher),
handler,
);
for input in vec![
br#"{"Users": [1,2]"#.to_vec(),
br#", "users": [3, 4]}"#.to_vec(),
] {
trigger.process(&input).unwrap();
}
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Regex
impl RefUnwindSafe for Regex
impl Send for Regex
impl Sync for Regex
impl Unpin for Regex
impl UnwindSafe for Regex
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