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

Method append_content

atomic-core/src/record/workflow/globalize/context.rs:192–198  ·  view source on GitHub ↗

Append content to the buffer and return the position range. # Arguments `data` - Content bytes to append # Returns A tuple of (start_position, end_position) for the appended content. # Example ```rust,ignore let (start, end) = ctx.append_content(b"Hello"); assert_eq!(end - start, 5); ```

(&mut self, data: &[u8])

Source from the content-addressed store, hash-verified

190 /// assert_eq!(end - start, 5);
191 /// ```
192 pub fn append_content(&mut self, data: &[u8]) -> (ChangePosition, ChangePosition) {
193 let start = ChangePosition::new(self.content_position);
194 self.content.extend_from_slice(data);
195 self.content_position += data.len() as u64;
196 let end = ChangePosition::new(self.content_position);
197 (start, end)
198 }
199
200 /// Add a dependency on an existing change.
201 ///

Callers 6

file_move_from_claimMethod · 0.45
globalize_recorded_fileFunction · 0.45
ensure_directory_anchorFunction · 0.45
create_name_vertexFunction · 0.45
create_content_vertexFunction · 0.45

Calls 1

lenMethod · 0.45

Tested by

no test coverage detected