[go: up one dir, main page]

pub async fn write_hash_with_algo<P, D>(
    algo: Algorithm,
    cache: P,
    data: D
) -> Result<Integrity>
where P: AsRef<Path>, D: AsRef<[u8]>,
Expand description

Writes data to the cache, skipping associating an index key with it. Use this to customize the hashing algorithm.

§Example

use async_attributes;

#[async_attributes::main]
async fn main() -> cacache::Result<()> {
    cacache::write_hash_with_algo(cacache::Algorithm::Xxh3, "./my-cache", b"hello").await?;
    Ok(())
}