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

Method append_contents

atomic-core/src/record/builder.rs:272–276  ·  view source on GitHub ↗

Append raw bytes to the contents buffer. Returns the starting position of the appended content, which can be used to reference this content in hunks. # Arguments `data` - The bytes to append # Returns The byte offset where the content was appended. # Example ```rust use atomic_core::record::RecordBuilder; let mut builder = RecordBuilder::new(); let start = builder.append_contents(b"Hello"

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

Source from the content-addressed store, hash-verified

270 /// assert_eq!(start2, 5);
271 /// ```
272 pub fn append_contents(&mut self, data: &[u8]) -> u64 {
273 let start = self.contents.len() as u64;
274 self.contents.extend_from_slice(data);
275 start
276 }
277
278 /// Get a reference to the contents buffer.
279 ///

Callers 8

test_append_contentsFunction · 0.45
test_finish_with_dataFunction · 0.45
test_clearFunction · 0.45
test_stats_populatedFunction · 0.45
test_recorded_into_partsFunction · 0.45

Calls 1

lenMethod · 0.45

Tested by 8

test_append_contentsFunction · 0.36
test_finish_with_dataFunction · 0.36
test_clearFunction · 0.36
test_stats_populatedFunction · 0.36
test_recorded_into_partsFunction · 0.36