pub async fn try_remove(&self, k: &K) -> Result<(), CacheError> {
        if self.is_closed.load(Ordering::SeqCst) {
            return Ok(());
        }

        let (index, conflict) = self.key_to_hash.build_key(&k);
        // delete immediately
        let prev = self.store.try_remove(&index, conflict)?;

        if let Some(prev) = prev {
            self.callback.on_exit(Some(prev.value.into_inner()));
        }
        // If we've set an item, it would be applied slightly later.
        // So we must push the same item to `setBuf` with the deletion flag.
        // This ensures that if a set is followed by a delete, it will be
        // applied in the correct order.
        let _ = self.insert_buf_tx.send(Item::delete(index, conflict)).await;

        Ok(())
    }
/// try to remove an entry from the Cache by key
try to remove an entry from the Cache by key
try to remove an entry from the Cache by key
pub async fn try_remove(&self, k: &K) -> Result<(), CacheError> {
        if self.is_closed.load(Ordering::SeqCst) {
            return Ok(());
        }
        let (index, conflict) = self.key_to_hash.build_key(&k);
        // delete immediately
        let prev = self.store.try_remove(&index, conflict)?;
        if let Some(prev) = prev {
            self.callback.on_exit(Some(prev.value.into_inner()));
        }
        // If we've set an item, it would be applied slightly later.
        // So we must push the same item to `setBuf` with the deletion flag.
        // This ensures that if a set is followed by a delete, it will be
        // applied in the correct order.
        let _ = self.insert_buf_tx.send(Item::delete(index, conflict)).await;
        Ok(())
    }
pub async fn try_remove ( & self , k : & K ) -> Result < ( ) , CacheError > { if self . is_closed . load ( Ordering :: SeqCst ) { return Ok ( ( ) ) ; } let ( index , conflict ) = self . key_to_hash . build_key ( & k ) ; // delete immediately let prev = self . store . try_remove ( & index , conflict ) ? ; if let Some ( prev ) = prev { self . callback . on_exit ( Some ( prev . value . into_inner ( ) ) ) ; } // If we've set an item, it would be applied slightly later. // So we must push the same item to `setBuf` with the deletion flag. // This ensures that if a set is followed by a delete, it will be // applied in the correct order. let _ = self . insert_buf_tx . send ( Item :: delete ( index , conflict ) ) . await ; Ok ( ( ) ) }
try to remove an entry from the Cache by key
try to remove an entry from the Cache by key
&self
k
&K
&self
k
&K