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

Function write_span_hunks_with_index

atomic-repository/src/apply/mod.rs:257–280  ·  view source on GitHub ↗

The caller must either index the span operations in this transaction or have proved the existing ambient index before a reference-only insertion. The ordinary public writer must never discard span operations.

(
    txn: &mut WriteTxn<'_>,
    view_name: &str,
    change_id: NodeId,
    change_hash: &Hash,
    change: &Change,
    options: &InsertOptions,
    already_in_graph: bool,
)

Source from the content-addressed store, hash-verified

255// have proved the existing ambient index before a reference-only insertion.
256// The ordinary public writer must never discard span operations.
257pub(crate) fn write_span_hunks_with_index(
258 txn: &mut WriteTxn<'_>,
259 view_name: &str,
260 change_id: NodeId,
261 change_hash: &Hash,
262 change: &Change,
263 options: &InsertOptions,
264 already_in_graph: bool,
265) -> InsertResult<InsertOutcome> {
266 if change.hashed.span.is_none() {
267 return Err(InsertError::InvalidChange {
268 message: "span change required".into(),
269 });
270 }
271 write_change_to_graph_inner(
272 txn,
273 view_name,
274 change_id,
275 change_hash,
276 change,
277 options,
278 already_in_graph,
279 )
280}
281
282#[allow(clippy::too_many_arguments)]
283fn write_change_to_graph_inner(

Callers 4

insert_changeMethod · 0.85

Calls 2

is_noneMethod · 0.80

Tested by

no test coverage detected