Function rscache::util::load_store [−][src]
pub fn load_store<S: Store, P: AsRef<Path>>(path: P) -> Result<S>
Expand description
Loads the given store.
This will load the main cache file and open the chosen store with it.
Errors
Returns an std::io::Error
if the path is incorrect.
Examples
use rscache::{ Store, util };
let store: CustomStore = util::load_store("./data/osrs_cache")?;
struct CustomStore;
impl Store for CustomStore {
fn new(mut main_file: File) -> rscache::Result<Self> {
// snip
Ok(Self { })
}
}