| 275 | |
| 276 | #[inline] |
| 277 | pub fn lookup<K, Doc>(&self, key: &K) -> Result<Option<Ref<K, Doc>>, SessionResult> |
| 278 | where |
| 279 | Doc: Serialize + DeserializeOwned + Clone + Send + 'static + Document, |
| 280 | K: Serialize |
| 281 | + DeserializeOwned |
| 282 | + PartialOrd |
| 283 | + Ord |
| 284 | + PartialEq |
| 285 | + Eq |
| 286 | + Hash |
| 287 | + Clone |
| 288 | + Send |
| 289 | + Sync |
| 290 | + 'static |
| 291 | { |
| 292 | match self.datastores.get::<Storage<K, Doc>>() { |
| 293 | None => Err(SessionResult::DataStoreNotFound), |
| 294 | Some(datastore) => { |
| 295 | let res = datastore.lookup(key); |
| 296 | Ok(res) |
| 297 | } |
| 298 | } |
| 299 | } |
| 300 | |
| 301 | |
| 302 | #[inline] |