pub fn from_toml(structure_def_path: impl AsRef<Path>) -> Result<Node>Expand description
Load a filesystem structure definition from a TOML file and convert it to a validation model.
§Arguments
structure_def_path- Path to the TOML file containing the structure definition
§Returns
Result<model::Node>- The root node of the validation model
§Example
use anyhow::Result;
use fsvalidator::from_toml;
use fsvalidator::display::format_validation_result;
fn main() -> Result<()> {
let root = from_toml("path/to/structure.toml")?;
// Validate and get comprehensive results
let path = "./path/to/validate";
let result = root.validate(path);
println!("{}", format_validation_result(&result, path));
// Check if validation passed
if result.is_ok() {
println!("Validation passed!");
}
Ok(())
}