Function cacache::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(())
}