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

Function stored_vm_from_wasm

crates/wasm/src/vm_class.rs:93–99  ·  view source on GitHub ↗
(wasm_vm: &WASMVirtualMachine)

Source from the content-addressed store, hash-verified

91 .expect("VirtualMachine inside of WASM crate should have wasm_id set")
92}
93pub(crate) fn stored_vm_from_wasm(wasm_vm: &WASMVirtualMachine) -> Rc<StoredVirtualMachine> {
94 STORED_VMS.with_borrow(|vms| {
95 vms.get(&wasm_vm.id)
96 .expect("VirtualMachine is not valid")
97 .clone()
98 })
99}
100pub(crate) fn weak_vm(vm: &VirtualMachine) -> Weak<StoredVirtualMachine> {
101 let id = get_vm_id(vm);
102 STORED_VMS.with_borrow(|vms| Rc::downgrade(vms.get(id).expect("VirtualMachine is not valid")))

Callers 2

newMethod · 0.85
py_to_jsFunction · 0.85

Calls 2

cloneMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected