Function read_json

pub fn read_json<P>(path: P) -> Result<Inventory, Error>
where P: AsRef<Path>,
Expand description

Read the full JSON inventory results

The path takes anything that can be turned into a Path reference, such as a &str, String, Path, etc…

Returns a result containing the full Inventory data with every Interval.

Example

// Read the JSON inventory data
let inventory: Inventory = read_json("path/to/results.json").unwrap();