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:254–277  ·  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

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

Callers 4

insert_changeMethod · 0.85

Calls 2

is_noneMethod · 0.80

Tested by

no test coverage detected