/// Try to delete all values of type `V` saved under keys of type `K`, leaving values of other types,
/// as well as values of the same type but saved under another key type, untouched.
Try to delete all values of type `V` saved under keys of type `K`, leaving values of other types,
as well as values of the same type but saved under another key type, untouched.
Try to delete all values of type ` V ` saved under keys of type ` K ` leaving values of other types as well as values of the same type but saved under another key type untouched .
pub async fn clear<K, V>(&self) -> Result<(), Error>
    where
        K: Ord + Send + Sync + 'static,
        V: Send + Sync + 'static,
    {
        let key_id = TypeId::of::<K>();
        let value_id = TypeId::of::<V>();
        let (tx, rx) = oneshot::channel();
        let req = CacheReq::Clear(key_id, value_id, tx);
        self.sender.unbounded_send(req).map_err(|_| Error::MainUnreachable)?;
        let resp = rx.await.map_err(|_| Error::Other)?;
        match resp {
            CacheResp::Done => return Ok(()),
            CacheResp::Err(err) => return Err(err),
            _ => return Err(Error::Internal),
        }
    }
pub async fn clear < K , V > ( & self ) -> Result < ( ) , Error > where K : Ord + Send + Sync + ' static , V : Send + Sync + ' static , { let key_id = TypeId :: of :: < K > ( ) ; let value_id = TypeId :: of :: < V > ( ) ; let ( tx , rx ) = oneshot :: channel ( ) ; let req = CacheReq :: Clear ( key_id , value_id , tx ) ; self . sender . unbounded_send ( req ) . map_err ( | _ | Error :: MainUnreachable ) ? ; let resp = rx . await . map_err ( | _ | Error :: Other ) ? ; match resp { CacheResp :: Done => return Ok ( ( ) ) , CacheResp :: Err ( err ) => return Err ( err ) , _ => return Err ( Error :: Internal ) , } }
Try to delete all values of type `V` saved under keys of type `K`, leaving values of other types,
as well as values of the same type but saved under another key type, untouched.
Try to delete all values of type ` V ` saved under keys of type ` K ` leaving values of other types as well as values of the same type but saved under another key type untouched .
&self