Function cacache::read_hash_sync
source · [−]Expand description
Reads the entire contents of a cache file synchronously into a bytes vector, looking the data up by its content address.
Example
use std::io::Read;
fn main() -> cacache::Result<()> {
let sri = cacache::write_sync("./my-cache", "my-key", b"hello")?;
let data = cacache::read_hash_sync("./my-cache", &sri)?;
Ok(())
}