pub fn load_state<T: DeserializeOwned + Default>(path: &Path) -> Result<T>Expand description
Load state from a JSON file.
- If the file does not exist, returns the type’s
Defaultvalue. - If the file exists but cannot be parsed, returns an error.
§Errors
Returns io::Error if the file exists but cannot be read or parsed.