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

Function leaf_op_id

atomic-agent/src/transcript/reasoning.rs:364–367  ·  view source on GitHub ↗

Extract the (change_id, leaf_idx) tuple from a LeafOp, if it references an existing leaf. Insert ops don't carry an assigned LeafId (the ID is assigned during apply), so they return None. Delete, Replace, and Restore reference existing leaves.

(op: &atomic_core::crdt::LeafOp)

Source from the content-addressed store, hash-verified

362/// Insert ops don't carry an assigned LeafId (the ID is assigned during apply),
363/// so they return None. Delete, Replace, and Restore reference existing leaves.
364fn leaf_op_id(op: &atomic_core::crdt::LeafOp) -> Option<(u64, u32)> {
365 op.leaf_id()
366 .map(|lid| (lid.change_id().get(), lid.leaf_idx()))
367}

Callers 1

anchor_to_graphFunction · 0.85

Calls 4

leaf_idxMethod · 0.80
getMethod · 0.65
leaf_idMethod · 0.45
change_idMethod · 0.45

Tested by

no test coverage detected