Skip to main content

load_index

Function load_index 

Source
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

§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());