Skip to main content

get_archived_unit

Function get_archived_unit 

Source
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

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