/// Copies a cache entry by key to a specified location.
Copies a cache entry by key to a specified location.
Copies a cache entry by key to a specified location .
pub async fn copy<P, K, Q>(cache: P, key: K, to: Q) -> Result<u64, Error>
where
    P: AsRef<Path>,
    K: AsRef<str>,
    Q: AsRef<Path>,
{
    if let Some(entry) = index::find_async(cache.as_ref(), key.as_ref()).await? {
        copy_hash(cache, &entry.integrity, to).await
    } else {
        Err(Error::NotFound)
    }
}
pub async fn copy < P , K , Q > ( cache : P , key : K , to : Q ) -> Result < u64 , Error > where P : AsRef < Path > , K : AsRef < str > , Q : AsRef < Path > , { if let Some ( entry ) = index :: find_async ( cache . as_ref ( ) , key . as_ref ( ) ) . await ? { copy_hash ( cache , & entry . integrity , to ) . await } else { Err ( Error :: NotFound ) } }
Copies a cache entry by key to a specified location.
Copies a cache entry by key to a specified location .
cache
P
key
K
to
Q