copy_hash

Function copy_hash 

Source
pub fn copy_hash<P, Q>(cache: P, sri: &Integrity, to: Q) -> Result<u64>
where P: AsRef<Path>, Q: AsRef<Path>,
Expand description

Copies a cache entry by integrity address to a specified location. Returns the number of bytes copied.

ยงExample

use std::io::Read;

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