[go: up one dir, main page]

cacache 2.0.0

Content-addressable, key-value, high-performance, on-disk cache.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use std::fs;
use std::path::Path;

use async_std::fs as afs;
use ssri::Integrity;

use crate::content::path;
use crate::errors::Error;

pub fn rm(cache: &Path, sri: &Integrity) -> Result<(), Error> {
    fs::remove_file(path::content_path(&cache, &sri))?;
    Ok(())
}

pub async fn rm_async(cache: &Path, sri: &Integrity) -> Result<(), Error> {
    afs::remove_file(path::content_path(&cache, &sri)).await?;
    Ok(())
}