MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / get_view_by_id

Method get_view_by_id

atomic-core/src/pristine/txn/read.rs:476–486  ·  view source on GitHub ↗
(&self, id: u64)

Source from the content-addressed store, hash-verified

474
475impl ViewTxnT for ReadTxn {
476 fn get_view_by_id(&self, id: u64) -> PristineResult<Option<ViewState>> {
477 let table = self.txn.open_table(VIEWS)?;
478 for result in table.iter()? {
479 let (_key, value) = result?;
480 let state = deserialize_view_state(value.value())?;
481 if state.id == id {
482 return Ok(Some(state));
483 }
484 }
485 Ok(None)
486 }
487
488 fn get_view(&self, name: &str) -> PristineResult<Option<ViewState>> {
489 let table = self.txn.open_table(VIEWS)?;

Callers

nothing calls this directly

Calls 3

deserialize_view_stateFunction · 0.85
valueMethod · 0.80
iterMethod · 0.45

Tested by

no test coverage detected