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:311–321  ·  view source on GitHub ↗
(&self, id: u64)

Source from the content-addressed store, hash-verified

309
310impl ViewTxnT for ReadTxn {
311 fn get_view_by_id(&self, id: u64) -> PristineResult<Option<ViewState>> {
312 let table = self.txn.open_table(VIEWS)?;
313 for result in table.iter()? {
314 let (_key, value) = result?;
315 let state = deserialize_view_state(value.value())?;
316 if state.id == id {
317 return Ok(Some(state));
318 }
319 }
320 Ok(None)
321 }
322
323 fn get_view(&self, name: &str) -> PristineResult<Option<ViewState>> {
324 let table = self.txn.open_table(VIEWS)?;

Callers

nothing calls this directly

Calls 2

deserialize_view_stateFunction · 0.85
iterMethod · 0.45

Tested by

no test coverage detected