Add a bidirectional edge pair through the cached writer, mapping storage errors into the apply error type. This is the single edge-writing entry point shared by both insertion and edge-update application.
(
txn: &mut CachedWriteGraphTxn<'_, '_>,
inode: Option<Inode>,
flag: EdgeFlags,
source: GraphNode<NodeId>,
dest: GraphNode<NodeId>,
introduced_by: NodeId,
)
| 332 | /// This is the single edge-writing entry point shared by both insertion and |
| 333 | /// edge-update application. |
| 334 | pub(crate) fn add_edge_with_reverse( |
| 335 | txn: &mut CachedWriteGraphTxn<'_, '_>, |
| 336 | inode: Option<Inode>, |
| 337 | flag: EdgeFlags, |
| 338 | source: GraphNode<NodeId>, |
| 339 | dest: GraphNode<NodeId>, |
| 340 | introduced_by: NodeId, |
| 341 | ) -> Result<(), LocalApplyError> { |
| 342 | txn.add_edge_with_reverse(inode, flag, source, dest, introduced_by) |
| 343 | .map_err(|e| LocalApplyError::Internal { |
| 344 | message: format!("Failed to add edge pair: {}", e), |
| 345 | }) |
| 346 | } |
| 347 | |
| 348 | #[inline] |
| 349 | fn deserialize_graph_edge(bytes: &[u8; 24]) -> SerializedGraphEdge { |
no test coverage detected