Function bakery::load_from_file[][src]

pub fn load_from_file<T>(path: &str) -> Result<T, LoadError> where
    T: DeserializeOwned + Recipe
Expand description

Load an object from a data file, with recipe built using Recipe trait.

If the binary image of the data file does not exist or is deprecated, it is built and cached. If the recipe changes because the program code has been modified, binary must be removed manually as it is currently not detected.

The cache file has the same path as the data file, with the .dat extension replaced with .bin.

Arguments

  • dat_path - Path to the data file. File extension must be .dat.