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

Method content

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

Returns the content of the operation (for Insert or Delete). For Modify, returns the **new** content. Returns `None` for `Restore` operations.

(&self)

Source from the content-addressed store, hash-verified

391 /// For Modify, returns the **new** content.
392 /// Returns `None` for `Restore` operations.
393 pub fn content(&self) -> Option<&[LeafOp]> {
394 match self {
395 BranchOp::Insert { content, .. } => Some(content),
396 BranchOp::Delete { content, .. } => Some(content),
397 BranchOp::Modify { new_content, .. } => Some(new_content),
398 BranchOp::Restore { .. } => None,
399 BranchOp::Reparent { .. } => None,
400 }
401 }
402
403 /// Returns the old content for a Delete or Modify operation.
404 ///

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected