MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / module_for_instance

Method module_for_instance

crates/wasmtime/src/runtime/store.rs:1629–1641  ·  view source on GitHub ↗
(&self, instance: StoreInstanceId)

Source from the content-addressed store, hash-verified

1627 }
1628
1629 pub fn module_for_instance(&self, instance: StoreInstanceId) -> Option<&'_ Module> {
1630 instance.store_id().assert_belongs_to(self.id());
1631 match self.instances[instance.instance()].kind {
1632 StoreInstanceKind::Dummy => None,
1633 StoreInstanceKind::Real { module_id } => {
1634 let module = self
1635 .modules()
1636 .module_by_id(module_id)
1637 .expect("should always have a registered module for real instances");
1638 Some(module)
1639 }
1640 }
1641 }
1642
1643 /// Accessor from `InstanceId` to `&vm::Instance`.
1644 ///

Callers 1

_moduleMethod · 0.80

Calls 7

module_by_idMethod · 0.80
assert_belongs_toMethod · 0.45
store_idMethod · 0.45
idMethod · 0.45
instanceMethod · 0.45
expectMethod · 0.45
modulesMethod · 0.45

Tested by

no test coverage detected