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

Method import_ids

atomic-core/src/pristine/slice.rs:654–669  ·  view source on GitHub ↗
(&mut self, ids: &[IdRow])

Source from the content-addressed store, hash-verified

652 }
653
654 fn import_ids(&mut self, ids: &[IdRow]) -> PristineResult<()> {
655 let mut external = self.txn.open_table(EXTERNAL)?;
656 let mut internal = self.txn.open_table(INTERNAL)?;
657 let mut types = self.txn.open_table(NODE_TYPES)?;
658 for (id, hash, t) in ids {
659 external.insert(*id, hash)?;
660 internal.insert(hash, *id)?;
661 if let Some(t) = t {
662 types.insert(*id, *t)?;
663 }
664 }
665 let max = ids.iter().map(|(id, _, _)| *id).max().unwrap_or(0);
666 self.next_node_id
667 .fetch_max(max + 1, std::sync::atomic::Ordering::SeqCst);
668 Ok(())
669 }
670
671 /// Write `snapshot` as a view — its own scope, its own parent, its own
672 /// change log, with the repository's id, state and change count —

Callers 2

import_skeletonMethod · 0.80
import_graph_sliceMethod · 0.80

Calls 2

insertMethod · 0.45
iterMethod · 0.45

Tested by

no test coverage detected