pub fn scan_paths<'a>(
paths: impl IntoIterator<Item = &'a Path>,
options: &ScanOptions,
) -> Result<Output>Expand description
Scan multiple native filesystem inputs in one in-process workflow run.
Absolute paths are supported as long as they can be resolved through a shared scan root by the internal pipeline.
use provenant::workflow::{scan_paths, ScanOptions};
use std::fs;
use std::time::{SystemTime, UNIX_EPOCH};
let unique = SystemTime::now().duration_since(UNIX_EPOCH)?.as_nanos();
let root = std::env::temp_dir().join(format!("provenant-workflow-docs-{unique}"));
let left = root.join("left");
let right = root.join("right");
fs::create_dir_all(&left)?;
fs::create_dir_all(&right)?;
fs::write(left.join("one.txt"), "left\n")?;
fs::write(right.join("two.txt"), "right\n")?;
let output = scan_paths([left.as_path(), right.as_path()], &ScanOptions::default())?;
let paths: Vec<_> = output.files.iter().map(|file| file.path.as_str()).collect();
assert!(paths.iter().any(|path| path.ends_with("one.txt")));
assert!(paths.iter().any(|path| path.ends_with("two.txt")));
fs::remove_dir_all(&root)?;