pub fn get_archived_unit(mana_dir: &Path, id: &str) -> Result<Unit, ManaError>Expand description
Load a unit from the archive by ID.
Searches the .mana/archive/ tree for a unit that was previously closed
and archived.
§Errors
ManaError::UnitNotFound— unit ID not found in archiveManaError::InvalidId— ID is empty or contains invalid charactersManaError::ParseError— file cannot be deserializedManaError::IoError— filesystem failure
§Example
use mana_core::api::get_archived_unit;
use std::path::Path;
let mana_dir = Path::new("/project/.mana");
let unit = get_archived_unit(mana_dir, "42").unwrap();
println!("Closed at: {:?}", unit.closed_at);