processing/
processing.rs

1use anyhow::{Ok, Result};
2use processing_chain::{run_process, items::Item, processes::simple_process::Process};
3use std::env;
4use std::path::PathBuf;
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
17fn main() -> Result<()> {
18    let proc = Process {
19        name: String::from("Test"),
20        inputs_dir_path: env::current_dir()?,
21        inputs_extenion: String::from("toml"),
22        outputs_dir_path: PathBuf::from("Test"),
23        ..Process::default()
24    };
25    let _proc = run_process(proc, _process_item)?;
26    Ok(())
27}