Apply a Insertion atom to the graph. Creates a new span and connects it to the graph via context edges. This is how new content is inserted into files. # Arguments `txn` - Write transaction for graph modifications `workspace` - Workspace for tracking state and conflicts `change_id` - Internal ID of the change being applied `insertion` - The Insertion specification `change` - The full change for
(
txn: &mut CachedWriteGraphTxn<'_, '_>,
workspace: &mut Workspace,
change_id: NodeId,
insertion: &Insertion<Option<Hash>>,
change: &Change,
detect_conflicts: bool,
)
| 86 | /// - `BlockNotFound`: Context position not found |
| 87 | /// - `Internal`: Database error |
| 88 | pub fn write_new_vertex( |
| 89 | txn: &mut CachedWriteGraphTxn<'_, '_>, |
| 90 | workspace: &mut Workspace, |
| 91 | change_id: NodeId, |
| 92 | insertion: &Insertion<Option<Hash>>, |
| 93 | change: &Change, |
| 94 | detect_conflicts: bool, |
| 95 | ) -> Result<(), LocalApplyError> { |
| 96 | if !change.causal_frontier().is_empty() { |
| 97 | return Err(LocalApplyError::CausalFrontierInvalid { |
| 98 | reason: "frontier-bearing insertion requires a verified closure".to_string(), |
| 99 | }); |
| 100 | } |
| 101 | write_new_vertex_with_frontier( |
| 102 | txn, |
| 103 | workspace, |
| 104 | change_id, |
| 105 | insertion, |
| 106 | change, |
| 107 | &VerifiedCausalFrontier::empty(), |
| 108 | detect_conflicts, |
| 109 | ) |
| 110 | } |
| 111 | |
| 112 | /// Write a new vertex using repository-verified causal knowledge. |
| 113 | pub fn write_new_vertex_with_frontier( |
nothing calls this directly
no test coverage detected