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

Method obj_bytes

crates/vm/src/builtins/memory.rs:386–394  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

384 }
385
386 fn obj_bytes(&self) -> BorrowedValue<'_, [u8]> {
387 if self.desc.is_contiguous() {
388 BorrowedValue::map(self.buffer.obj_bytes(), |x| {
389 &x[self.start..self.start + self.desc.len]
390 })
391 } else {
392 BorrowedValue::map(self.buffer.obj_bytes(), |x| &x[self.start..])
393 }
394 }
395
396 fn obj_bytes_mut(&self) -> BorrowedValueMut<'_, [u8]> {
397 if self.desc.is_contiguous() {

Callers 8

getitem_by_multi_idxMethod · 0.45
unpack_singleMethod · 0.45
eqMethod · 0.45
as_contiguousMethod · 0.45
append_toMethod · 0.45
setitem_by_sliceMethod · 0.45
tolistMethod · 0.45
memory.rsFile · 0.45

Calls 1

is_contiguousMethod · 0.80

Tested by

no test coverage detected