remove_hash

Function remove_hash 

Source
pub fn remove_hash<P: AsRef<Path>>(cache: P, sri: &Integrity) -> Result<()>
Expand description

Removes an individual content entry synchronously. Any index entries pointing to this content will become invalidated.

ยงExample

use std::io::Read;

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

    cacache_sync::remove_hash("./my-cache", &sri)?;

    // These fail:
    cacache_sync::read("./my-cache", "my-key")?;
    cacache_sync::read_hash("./my-cache", &sri)?;

    // But this succeeds:
    cacache_sync::metadata("./my-cache", "my-key")?;

    Ok(())
}