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

Method id_rows

atomic-core/src/pristine/slice.rs:477–493  ·  view source on GitHub ↗

`IdRow`s for `ids`. An id with no `EXTERNAL` row is dropped: a change can be visible on a view without being registered yet, and callers treat a missing row as "not mine to carry". A drop is still a silent way to lose an id, so a miss in a debug build asserts — a mis-decoded id (see the endianness rule in `tables.rs`) looks exactly like an absent one.

(&self, ids: impl Iterator<Item = u64>)

Source from the content-addressed store, hash-verified

475 /// mis-decoded id (see the endianness rule in `tables.rs`) looks exactly
476 /// like an absent one.
477 fn id_rows(&self, ids: impl Iterator<Item = u64>) -> PristineResult<Vec<IdRow>> {
478 let external = self.txn.open_table(EXTERNAL)?;
479 let node_types = self.txn.open_table(NODE_TYPES)?;
480 let mut out = Vec::new();
481 for id in ids {
482 if let Some(h) = external.get(id)? {
483 let t = node_types.get(id)?.map(|t| t.value());
484 out.push((id, *h.value(), t));
485 } else {
486 debug_assert!(
487 false,
488 "id {id} has no EXTERNAL row; was it decoded correctly?"
489 );
490 }
491 }
492 Ok(out)
493 }
494
495 /// The view's snapshot: its own state, and every change it can see.
496 pub fn export_view_snapshot(&self, view: &ViewState, visible: Vec<u64>) -> ViewSnapshotRows {

Callers 2

export_skeletonMethod · 0.80
export_graph_sliceMethod · 0.80

Calls 3

valueMethod · 0.80
getMethod · 0.65
pushMethod · 0.45

Tested by

no test coverage detected