Expand description
Handler which alters indentation of matched data
§Example
use streamson_lib::{handler, matcher, strategy::{self, Strategy}};
use std::sync::{Arc, Mutex};
let handler = Arc::new(Mutex::new(handler::Indenter::new(Some(2))));
let mut all = strategy::All::new();
all.set_convert(true);
// Set the handler for all strategy
all.add_handler(handler);
for input in vec![
br#"{"users": [{"password": "1234", "name": "first"}, {"#.to_vec(),
br#""password": "0000", "name": "second}]}"#.to_vec(),
] {
for converted_data in all.process(&input).unwrap() {
println!("{:?}", converted_data);
}
}
Structs§
- Indenter
- Handler which alters indentation of matched data