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

Method create_branch

atomic-core/src/crdt/apply/traits.rs:410–419  ·  view source on GitHub ↗

Creates a new branch (line) in a trunk. # Arguments `id` - The branch ID `trunk_id` - The parent trunk `after` - Insert after this branch, or `None` for start

(
        &mut self,
        id: BranchId,
        trunk_id: TrunkId,
        after: Option<BranchId>,
    )

Source from the content-addressed store, hash-verified

408 /// * `trunk_id` - The parent trunk
409 /// * `after` - Insert after this branch, or `None` for start
410 fn create_branch(
411 &mut self,
412 id: BranchId,
413 trunk_id: TrunkId,
414 after: Option<BranchId>,
415 ) -> Result<Branch, Self::Error> {
416 let branch = Branch::new(id, trunk_id);
417 self.put_branch(&branch, after)?;
418 Ok(branch)
419 }
420
421 /// Marks a branch as deleted.
422 fn mark_branch_deleted(&mut self, id: BranchId) -> Result<(), Self::Error> {

Callers 2

test_create_branchFunction · 0.80
test_mark_branch_deletedFunction · 0.80

Implementers 1

traits.rsatomic-core/src/crdt/apply/traits.rs

Calls 1

put_branchMethod · 0.45

Tested by 2

test_create_branchFunction · 0.64
test_mark_branch_deletedFunction · 0.64