/// Opens a new file handle into the cache, looking it up in the index using
/// `key`.
Opens a new file handle into the cache, looking it up in the index using
`key`.
Opens a new file handle into the cache looking it up in the index using ` key ` .
pub async fn open<P, K>(cache: P, key: K) -> Result<AsyncGet, Error>
where
    P: AsRef<Path>,
    K: AsRef<str>,
{
    if let Some(entry) = index::find_async(cache.as_ref(), key.as_ref()).await? {
        open_hash(cache, entry.integrity).await
    } else {
        Err(Error::NotFound)
    }
}
pub async fn open < P , K > ( cache : P , key : K ) -> Result < AsyncGet , Error > where P : AsRef < Path > , K : AsRef < str > , { if let Some ( entry ) = index :: find_async ( cache . as_ref ( ) , key . as_ref ( ) ) . await ? { open_hash ( cache , entry . integrity ) . await } else { Err ( Error :: NotFound ) } }
Opens a new file handle into the cache, looking it up in the index using
`key`.
Opens a new file handle into the cache looking it up in the index using ` key ` .
cache
P
key
K