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:334–346  ·  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

332/// This is the single edge-writing entry point shared by both insertion and
333/// edge-update application.
334pub(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]
349fn deserialize_graph_edge(bytes: &[u8; 24]) -> SerializedGraphEdge {

Callers 2

write_new_edgeFunction · 0.85
write_new_vertexFunction · 0.85

Calls 1

add_edge_with_reverseMethod · 0.80

Tested by

no test coverage detected