pub fn read_sync<P, K>(cache: P, key: K) -> Result<Vec<u8>> where
    P: AsRef<Path>,
    K: AsRef<str>, 
Expand description

Reads the entire contents of a cache file synchronously into a bytes vector, looking the data up by key.

Example

use std::io::Read;

fn main() -> cacache::Result<()> {
    let data = cacache::read_sync("./my-cache", "my-key")?;
    Ok(())
}