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

Method size

crates/stdlib/src/mmap.rs:1325–1329  ·  view source on GitHub ↗
(&self, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

1323 #[cfg(unix)]
1324 #[pymethod]
1325 fn size(&self, vm: &VirtualMachine) -> std::io::Result<PyIntRef> {
1326 let fd = unsafe { crt_fd::Borrowed::try_borrow_raw(self.fd.load())? };
1327 let file_len = fstat(fd)?.st_size;
1328 Ok(PyInt::from(file_len).into_ref(&vm.ctx))
1329 }
1330
1331 #[cfg(windows)]
1332 #[pymethod]

Callers

nothing calls this directly

Calls 7

fstatFunction · 0.85
SomeClass · 0.50
ErrClass · 0.50
loadMethod · 0.45
into_refMethod · 0.45
__len__Method · 0.45
to_pyexceptionMethod · 0.45

Tested by

no test coverage detected