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

Method to_change_ops

atomic-core/src/record/workflow/crdt/builder/trunk.rs:108–119  ·  view source on GitHub ↗

Convert to the serializable `change::ops::FileOps` type.

(&self)

Source from the content-addressed store, hash-verified

106
107 /// Convert to the serializable `change::ops::FileOps` type.
108 pub fn to_change_ops(&self) -> change_ops::FileOps {
109 let mut result =
110 change_ops::FileOps::new(self.trunk_id, self.path.clone(), self.trunk_op.clone());
111
112 for line_op in &self.line_ops {
113 let change_line_op =
114 change_ops::LineOps::new(line_op.branch_id(), line_op.operation().clone());
115 result.add_line_op(change_line_op);
116 }
117
118 result
119 }
120
121 /// Consume and convert to the serializable `change::ops::FileOps` type.
122 pub fn into_change_ops(self) -> change_ops::FileOps {

Callers

nothing calls this directly

Calls 4

cloneMethod · 0.45
branch_idMethod · 0.45
operationMethod · 0.45
add_line_opMethod · 0.45

Tested by

no test coverage detected