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

Method obj_bytes_mut

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

Source from the content-addressed store, hash-verified

394 }
395
396 fn obj_bytes_mut(&self) -> BorrowedValueMut<'_, [u8]> {
397 if self.desc.is_contiguous() {
398 BorrowedValueMut::map(self.buffer.obj_bytes_mut(), |x| {
399 &mut x[self.start..self.start + self.desc.len]
400 })
401 } else {
402 BorrowedValueMut::map(self.buffer.obj_bytes_mut(), |x| &mut x[self.start..])
403 }
404 }
405
406 fn as_contiguous(&self) -> Option<BorrowedValue<'_, [u8]>> {
407 self.desc.is_contiguous().then(|| {

Callers 4

pack_singleMethod · 0.45
_as_contiguous_mutMethod · 0.45
setitem_by_sliceMethod · 0.45
memory.rsFile · 0.45

Calls 1

is_contiguousMethod · 0.80

Tested by

no test coverage detected