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

Method close

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

Source from the content-addressed store, hash-verified

938
939 #[pymethod]
940 fn close(&self, vm: &VirtualMachine) -> PyResult<()> {
941 if self.closed() {
942 return Ok(());
943 }
944
945 if self.exports.load() > 0 {
946 return Err(vm.new_buffer_error("cannot close exported pointers exist."));
947 }
948
949 let mut mmap = self.mmap.lock();
950 self.closed.store(true);
951 *mmap = None;
952
953 self.close_handle();
954
955 Ok(())
956 }
957
958 fn get_find_range(&self, options: FindOptions) -> (usize, usize) {
959 let size = self.__len__();

Callers 1

__exit__Method · 0.45

Calls 6

close_handleMethod · 0.80
ErrClass · 0.50
closedMethod · 0.45
loadMethod · 0.45
lockMethod · 0.45
storeMethod · 0.45

Tested by

no test coverage detected