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

Function add_edge_with_reverse

atomic-core/src/apply/graph_batch.rs:365–377  ·  view source on GitHub ↗

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,
)

Source from the content-addressed store, hash-verified

363/// This is the single edge-writing entry point shared by both insertion and
364/// edge-update application.
365pub(crate) fn add_edge_with_reverse(
366 txn: &mut CachedWriteGraphTxn<'_, '_>,
367 inode: Option<Inode>,
368 flag: EdgeFlags,
369 source: GraphNode<NodeId>,
370 dest: GraphNode<NodeId>,
371 introduced_by: NodeId,
372) -> Result<(), LocalApplyError> {
373 txn.add_edge_with_reverse(inode, flag, source, dest, introduced_by)
374 .map_err(|e| LocalApplyError::Internal {
375 message: format!("Failed to add edge pair: {}", e),
376 })
377}
378
379#[inline]
380fn deserialize_graph_edge(bytes: &[u8; 24]) -> SerializedGraphEdge {

Callers 2

write_new_edgeFunction · 0.85

Calls 1

add_edge_with_reverseMethod · 0.80

Tested by

no test coverage detected