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

Method insertion

atomic-core/src/change/format_v3/graph_fields/encode.rs:61–77  ·  view source on GitHub ↗
(&mut self, r: usize, v: &CompactInsertion)

Source from the content-addressed store, hash-verified

59 Ok(())
60 }
61 fn insertion(&mut self, r: usize, v: &CompactInsertion) -> FormatResult<()> {
62 self.n(ins(r, 0), v.flag.into());
63 self.n(ins(r, 1), v.start.into());
64 self.n(ins(r, 2), v.end.into());
65 self.position(ins(r, 3), v.inode);
66 charge(&mut self.budget, v.predecessors.len(), 16)?;
67 put(&mut self.control, v.predecessors.len() as u64);
68 for p in &v.predecessors {
69 self.position(ins(r, 5), *p);
70 }
71 charge(&mut self.budget, v.successors.len(), 16)?;
72 put(&mut self.control, v.successors.len() as u64);
73 for p in &v.successors {
74 self.position(ins(r, 7), *p);
75 }
76 Ok(())
77 }
78 fn edges(&mut self, r: usize, v: &CompactEdgeUpdate) -> FormatResult<()> {
79 self.position(edge(r, 0), v.inode);
80 charge(&mut self.budget, v.edges.len(), 64)?;

Callers 2

optional_insertionMethod · 0.45
opMethod · 0.45

Calls 6

insFunction · 0.85
chargeFunction · 0.70
putFunction · 0.70
nMethod · 0.45
positionMethod · 0.45
lenMethod · 0.45

Tested by

no test coverage detected