MCPcopy Create free account
hub / github.com/Rustixir/darkbird / lookup

Method lookup

src/darkbird/database.rs:277–299  ·  view source on GitHub ↗
(&self, key: &K)

Source from the content-addressed store, hash-verified

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]

Callers 1

vec_lookupMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected