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

Method check_valid

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

Source from the content-addressed store, hash-verified

908 }
909
910 fn check_valid(&self, vm: &VirtualMachine) -> PyResult<PyMutexGuard<'_, Option<MmapObj>>> {
911 let m = self.mmap.lock();
912
913 if m.is_none() {
914 return Err(vm.new_value_error("mmap closed or invalid"));
915 }
916
917 Ok(m)
918 }
919
920 /// TODO: impl resize
921 #[allow(dead_code)]

Callers 11

try_writableMethod · 0.80
findMethod · 0.80
rfindMethod · 0.80
flushMethod · 0.80
madviseMethod · 0.80
readMethod · 0.80
read_byteMethod · 0.80
readlineMethod · 0.80
__enter__Method · 0.80
getitem_by_indexMethod · 0.80
getitem_by_sliceMethod · 0.80

Calls 3

ErrClass · 0.50
lockMethod · 0.45
is_noneMethod · 0.45

Tested by

no test coverage detected