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

Method as_slice

crates/stdlib/src/mmap.rs:254–263  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

252
253 impl MmapObj {
254 fn as_slice(&self) -> &[u8] {
255 match self {
256 MmapObj::Read(mmap) => &mmap[..],
257 MmapObj::Write(mmap) => &mmap[..],
258 #[cfg(windows)]
259 MmapObj::Named(named) => unsafe {
260 core::slice::from_raw_parts(named.view_ptr, named.len)
261 },
262 }
263 }
264 }
265
266 #[pyattr]

Callers 15

rawMethod · 0.45
seedMethod · 0.45
setstateMethod · 0.45
as_bytesMethod · 0.45
findMethod · 0.45
rfindMethod · 0.45
readMethod · 0.45
read_byteMethod · 0.45
readlineMethod · 0.45
resizeMethod · 0.45
getitem_by_indexMethod · 0.45
getitem_by_sliceMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected