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

Method compact_new_edge

atomic-core/src/change/format_v3/compact/compactor.rs:119–131  ·  view source on GitHub ↗

Convert a `NewEdge >` to a [`CompactNewEdge`].

(&self, e: &NewEdge<Option<Hash>>)

Source from the content-addressed store, hash-verified

117
118 /// Convert a `NewEdge<Option<Hash>>` to a [`CompactNewEdge`].
119 pub fn compact_new_edge(&self, e: &NewEdge<Option<Hash>>) -> FormatResult<CompactNewEdge> {
120 let from = self.compact_position(&e.from)?;
121 let to = self.compact_graph_node(&e.to)?;
122 let introduced_by = self.hash_to_index(&e.introduced_by)?;
123
124 Ok(CompactNewEdge {
125 previous: e.previous.bits(),
126 flag: e.flag.bits(),
127 from,
128 to,
129 introduced_by,
130 })
131 }
132
133 /// Convert an `EdgeUpdate<Option<Hash>>` to a [`CompactEdgeUpdate`].
134 pub fn compact_edge_update(

Calls 3

compact_positionMethod · 0.80
compact_graph_nodeMethod · 0.80
hash_to_indexMethod · 0.80