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

Method branch_id

atomic-core/src/crdt/branch.rs:367–375  ·  view source on GitHub ↗

Returns the branch ID this operation affects, if any. Returns `None` for `Insert` since the ID is assigned later.

(&self)

Source from the content-addressed store, hash-verified

365 ///
366 /// Returns `None` for `Insert` since the ID is assigned later.
367 pub fn branch_id(&self) -> Option<BranchId> {
368 match self {
369 BranchOp::Insert { .. } => None,
370 BranchOp::Delete { branch, .. } => Some(*branch),
371 BranchOp::Modify { branch, .. } => Some(*branch),
372 BranchOp::Restore { branch } => Some(*branch),
373 BranchOp::Reparent { branch, .. } => Some(*branch),
374 }
375 }
376
377 /// Returns `true` if this is an insert operation.
378 #[inline]

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected