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

Method insert

atomic-core/src/change/ops.rs:651–662  ·  view source on GitHub ↗

Creates a line insert operation with leaf operations. # Arguments `branch_id` - The branch ID for this new line `after` - Insert after this branch ID (None = start of file) `leaf_ops` - The token operations for this line's content

(branch_id: BranchId, after: Option<BranchId>, leaf_ops: Vec<LeafOp>)

Source from the content-addressed store, hash-verified

649 /// * `after` - Insert after this branch ID (None = start of file)
650 /// * `leaf_ops` - The token operations for this line's content
651 pub fn insert(branch_id: BranchId, after: Option<BranchId>, leaf_ops: Vec<LeafOp>) -> Self {
652 Self {
653 branch_id,
654 operation: BranchOp::Insert {
655 after,
656 content: leaf_ops,
657 },
658 old_line_num: None,
659 new_line_num: None,
660 content_range: None,
661 }
662 }
663
664 /// Creates a line insert operation with line number.
665 pub fn insert_at(

Callers 11

referenced_node_idsMethod · 0.45
get_verified_changeMethod · 0.45
trustMethod · 0.45
newMethod · 0.45
localizeMethod · 0.45
serializeMethod · 0.45
collect_position_hashMethod · 0.45

Calls

no outgoing calls