pub fn lookup_key(&self, path: &'_ str) -> Result<Option<AssetMetadata>, Error> {
        // remove leading '/' if present
        let path = path.strip_prefix('/').unwrap_or(path);
        if path.is_empty() {
            return Err(Error::EmptyKey);
        }
        self.ensure_map()?;
        let map = self.map.borrow();
        let md = map.as_ref().unwrap().get(path).cloned();
        Ok(md)
    }
/// Finds the path in the map, returning the "key"
/// This lookup should reliably and quickly determine whether asset is in KV,
/// as it doesn't require querying KV yet.
/// Removes leading / if present
/// Returns Ok(None) if Not found
Finds the path in the map, returning the "key"
This lookup should reliably and quickly determine whether asset is in KV,
as it doesn't require querying KV yet.
Removes leading / if present
Returns Ok(None) if Not found
Finds the path in the map returning the " key " This lookup should reliably and quickly determine whether asset is in KV as it doesn ' t require querying KV yet . Removes leading / if present Returns Ok ( None ) if Not found
pub fn lookup_key(&self, path: &'_ str) -> Result<Option<AssetMetadata>, Error> {
        // remove leading '/' if present
        let path = path.strip_prefix('/').unwrap_or(path);
        if path.is_empty() {
            return Err(Error::EmptyKey);
        }
        self.ensure_map()?;
        let map = self.map.borrow();
        let md = map.as_ref().unwrap().get(path).cloned();
        Ok(md)
    }
pub fn lookup_key ( & self , path : & ' _ str ) -> Result < Option < AssetMetadata > , Error > { // remove leading '/' if present let path = path . strip_prefix ( '/' ) . unwrap_or ( path ) ; if path . is_empty ( ) { return Err ( Error :: EmptyKey ) ; } self . ensure_map ( ) ? ; let map = self . map . borrow ( ) ; let md = map . as_ref ( ) . unwrap ( ) . get ( path ) . cloned ( ) ; Ok ( md ) }
Finds the path in the map, returning the "key"
This lookup should reliably and quickly determine whether asset is in KV,
as it doesn't require querying KV yet.
Finds the path in the map returning the " key " This lookup should reliably and quickly determine whether asset is in KV as it doesn ' t require querying KV yet .
&self
path
&'_ str
&self
path
&'_ str