write

Function write 

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

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

ยงExample

use std::io::Read;

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