[][src]Function cacache::write_sync

pub fn write_sync<P, D, K>(cache: P, key: K, data: D) -> Result<Integrity> where
    P: AsRef<Path>,
    D: AsRef<[u8]>,
    K: AsRef<str>, 

Writes data to the cache synchronously, indexing it under key.

Example

use std::io::Read;

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