Convert a `NewEdge >` to a [`CompactNewEdge`].
(&self, e: &NewEdge<Option<Hash>>)
| 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( |