cacache

Function read

Source
pub async fn read<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 into a bytes vector, looking the data up by key.

ยงExample

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

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