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

Method append_content

atomic-core/src/record/workflow/globalize/context.rs:132–138  ·  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

130 /// assert_eq!(end - start, 5);
131 /// ```
132 pub fn append_content(&mut self, data: &[u8]) -> (ChangePosition, ChangePosition) {
133 let start = ChangePosition::new(self.content_position);
134 self.content.extend_from_slice(data);
135 self.content_position += data.len() as u64;
136 let end = ChangePosition::new(self.content_position);
137 (start, end)
138 }
139
140 /// Add a dependency on an existing change.
141 ///

Callers 4

globalize_recorded_fileFunction · 0.45
create_name_vertexFunction · 0.45
create_content_vertexFunction · 0.45

Calls 1

lenMethod · 0.45

Tested by

no test coverage detected