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

Function write_edge_map

atomic-core/src/apply/edge.rs:80–102  ·  view source on GitHub ↗

Write an EdgeUpdate atom to the graph. Modifies existing edges in the graph. This is primarily used for: - Marking content as deleted (adding DELETED flag) - Undeleting content (removing DELETED flag) - Changing edge properties Edges are written to the global GRAPH and INODE_GRAPH tables. # Arguments `txn` - Write transaction for graph modifications `workspace` - Workspace for tracking state a

(
    txn: &mut CachedWriteGraphTxn<'_, '_>,
    workspace: &mut Workspace,
    change_id: NodeId,
    edge_update: &EdgeUpdate<Option<Hash>>,
    change: &Change,
    detect_conflicts: bool,
)

Source from the content-addressed store, hash-verified

78/// - `BlockNotFound`: Source or target span doesn't exist
79/// - `Internal`: Database error
80pub fn write_edge_map(
81 txn: &mut CachedWriteGraphTxn<'_, '_>,
82 workspace: &mut Workspace,
83 change_id: NodeId,
84 edge_update: &EdgeUpdate<Option<Hash>>,
85 change: &Change,
86 detect_conflicts: bool,
87) -> Result<(), LocalApplyError> {
88 if !change.causal_frontier().is_empty() {
89 return Err(LocalApplyError::CausalFrontierInvalid {
90 reason: "frontier-bearing edge application requires a verified closure".to_string(),
91 });
92 }
93 write_edge_map_with_frontier(
94 txn,
95 workspace,
96 change_id,
97 edge_update,
98 change,
99 &VerifiedCausalFrontier::empty(),
100 detect_conflicts,
101 )
102}
103
104/// Write an edge update using repository-verified causal knowledge.
105pub fn write_edge_map_with_frontier(

Calls 3

causal_frontierMethod · 0.80
is_emptyMethod · 0.45