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

Source from the content-addressed store, hash-verified

329
330impl ViewTxnT for ReadTxn {
331 fn get_view_by_id(&self, id: u64) -> PristineResult<Option<ViewState>> {
332 let table = self.txn.open_table(VIEWS)?;
333 for result in table.iter()? {
334 let (_key, value) = result?;
335 let state = deserialize_view_state(value.value())?;
336 if state.id == id {
337 return Ok(Some(state));
338 }
339 }
340 Ok(None)
341 }
342
343 fn get_view(&self, name: &str) -> PristineResult<Option<ViewState>> {
344 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