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

Method as_contiguous

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

Source from the content-addressed store, hash-verified

404 }
405
406 fn as_contiguous(&self) -> Option<BorrowedValue<'_, [u8]>> {
407 self.desc.is_contiguous().then(|| {
408 BorrowedValue::map(self.buffer.obj_bytes(), |x| {
409 &x[self.start..self.start + self.desc.len]
410 })
411 })
412 }
413
414 fn _as_contiguous_mut(&self) -> Option<BorrowedValueMut<'_, [u8]>> {
415 self.desc.is_contiguous().then(|| {

Callers 2

append_toMethod · 0.45
contiguous_or_collectMethod · 0.45

Calls 3

is_contiguousMethod · 0.80
thenMethod · 0.45
obj_bytesMethod · 0.45

Tested by

no test coverage detected