processing_json/
processing_json.rs

1use anyhow::{Ok, Result};
2
3use processing_chain::{run_process, items::Item, processes::json_process::JsonProcess};
4
5
6fn _process_item(item: &Item) -> Result<bool> {
7    // define how to process a single item
8    println!(
9        "Processing {} {:?} -> {:?}",
10        item.name, item.input_item_paths, item.output_item_paths
11    );
12    // ...
13
14    Ok(true)
15}
16
17
18fn main() -> Result<()> {
19
20    let proc = JsonProcess {
21        name: String::from("JSON process"),
22        json_items: String::from("examples/items.json"),
23        ..JsonProcess::default()
24    };
25    let _proc = run_process(proc, _process_item)?;
26
27    Ok(())
28
29}
30