Function cacache::copy_hash_sync
source · [−]pub fn copy_hash_sync<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::Result<()> {
let sri = cacache::write_sync("./my-cache", "my-key", b"hello")?;
cacache::copy_hash_sync("./my-cache", &sri, "./my-hello.txt")?;
Ok(())
}