| 196 | |
| 197 | #[inline] |
| 198 | pub async fn remove<K, Doc>(&self, key: K) -> Result<(), SessionResult> |
| 199 | where |
| 200 | Doc: Serialize + DeserializeOwned + Clone + Send + 'static + Document, |
| 201 | K: Serialize |
| 202 | + DeserializeOwned |
| 203 | + PartialOrd |
| 204 | + Ord |
| 205 | + PartialEq |
| 206 | + Eq |
| 207 | + Hash |
| 208 | + Clone |
| 209 | + Send |
| 210 | + Sync |
| 211 | + 'static |
| 212 | { |
| 213 | match self.datastores.get::<Storage<K, Doc>>() { |
| 214 | None => Err(SessionResult::DataStoreNotFound), |
| 215 | Some(datastore) => { |
| 216 | datastore.remove(key).await |
| 217 | } |
| 218 | } |
| 219 | } |
| 220 | |
| 221 | |
| 222 | |