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

Method lookup_by_index

src/darkbird/database.rs:303–325  ·  view source on GitHub ↗
(&self, index_key: &str)

Source from the content-addressed store, hash-verified

301
302 #[inline]
303 pub fn lookup_by_index<K, Doc>(&self, index_key: &str) -> Result<Option<Ref<K, Doc>>, SessionResult>
304 where
305 Doc: Serialize + DeserializeOwned + Clone + Send + 'static + Document,
306 K: Serialize
307 + DeserializeOwned
308 + PartialOrd
309 + Ord
310 + PartialEq
311 + Eq
312 + Hash
313 + Clone
314 + Send
315 + Sync
316 + 'static
317 {
318 match self.datastores.get::<Storage<K, Doc>>() {
319 None => Err(SessionResult::DataStoreNotFound),
320 Some(datastore) => {
321 let res = datastore.lookup_by_index(index_key);
322 Ok(res)
323 }
324 }
325 }
326
327
328

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected