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

Method trunk_id

atomic-core/src/crdt/trunk.rs:345–353  ·  view source on GitHub ↗

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

(&self)

Source from the content-addressed store, hash-verified

343 ///
344 /// Returns `None` for `Create` since the ID is assigned later.
345 pub fn trunk_id(&self) -> Option<TrunkId> {
346 match self {
347 TrunkOp::Create { .. } | TrunkOp::ProjectedSpanEdit { .. } => None,
348 TrunkOp::Delete { trunk } => Some(*trunk),
349 TrunkOp::Move { trunk, .. } => Some(*trunk),
350 TrunkOp::Undelete { trunk } => Some(*trunk),
351 TrunkOp::SetMode { trunk, .. } | TrunkOp::SetKind { trunk, .. } => Some(*trunk),
352 }
353 }
354
355 /// Returns `true` if this is a create operation.
356 #[inline]

Calls

no outgoing calls

Tested by 2

test_multi_file_workflowFunction · 0.36