pub async fn read_hash<P>(cache: P, sri: &Integrity) -> Result<Vec<u8>> where
    P: AsRef<Path>, 
Expand description

Reads the entire contents of a cache file into a bytes vector, looking the data up by its content address.

Example

use async_std::prelude::*;
use async_attributes;

#[async_attributes::main]
async fn main() -> cacache::Result<()> {
    let sri = cacache::write("./my-cache", "my-key", b"hello").await?;
    let data: Vec<u8> = cacache::read_hash("./my-cache", &sri).await?;
    Ok(())
}