pub fn load_index(mana_dir: &Path) -> Result<Index, ManaError>Expand description
Load the index, rebuilding from unit files if stale.
The index is a YAML cache that’s faster than reading every unit file. It is automatically rebuilt when unit files are newer than the cached index.
§Errors
ManaError::IndexError— index cannot be built, loaded, or savedManaError::IoError— filesystem failure
§Example
use mana_core::api::load_index;
use std::path::Path;
let index = load_index(Path::new("/project/.mana")).unwrap();
println!("{} units", index.units.len());