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

Method destroy

crates/wasm/src/vm_class.rs:133–143  ·  view source on GitHub ↗
(id: String)

Source from the content-addressed store, hash-verified

131 }
132
133 pub fn destroy(id: String) {
134 STORED_VMS.with_borrow_mut(|vms| {
135 if let Some(stored_vm) = vms.remove(&id) {
136 // for f in stored_vm.drop_handlers.iter() {
137 // f();
138 // }
139 // deallocate the VM
140 drop(stored_vm);
141 }
142 });
143 }
144
145 pub fn ids() -> Vec<JsValue> {
146 STORED_VMS.with_borrow(|vms| vms.keys().map(|k| k.into()).collect())

Callers

nothing calls this directly

Calls 3

assert_validMethod · 0.80
removeMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected