MCPcopy Index your code
hub / github.com/RustPython/RustPython / append_to

Method append_to

crates/vm/src/protocol/buffer.rs:87–96  ·  view source on GitHub ↗
(&self, buf: &mut Vec<u8>)

Source from the content-addressed store, hash-verified

85 }
86
87 pub fn append_to(&self, buf: &mut Vec<u8>) {
88 if let Some(bytes) = self.as_contiguous() {
89 buf.extend_from_slice(&bytes);
90 } else {
91 let bytes = &*self.obj_bytes();
92 self.desc.for_each_segment(true, |range| {
93 buf.extend_from_slice(&bytes[range.start as usize..range.end as usize])
94 });
95 }
96 }
97
98 pub fn contiguous_or_collect<R, F: FnOnce(&[u8]) -> R>(&self, f: F) -> R {
99 let borrowed;

Callers 3

concatMethod · 0.45
try_from_objectMethod · 0.45
contiguous_or_collectMethod · 0.45

Calls 3

for_each_segmentMethod · 0.80
as_contiguousMethod · 0.45
obj_bytesMethod · 0.45

Tested by

no test coverage detected