[go: up one dir, main page]

write_hash_sync

Function write_hash_sync 

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

Writes data to the cache synchronously, skipping associating a key with it.

ยงExample

use std::io::Read;

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