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

Method get_import

crates/wasmtime/src/runtime/component/types.rs:1034–1039  ·  view source on GitHub ↗

Returns import associated with `name`, if such exists in the component

(&'a self, engine: &'a Engine, name: &str)

Source from the content-addressed store, hash-verified

1032
1033 /// Returns import associated with `name`, if such exists in the component
1034 pub fn get_import<'a>(&'a self, engine: &'a Engine, name: &str) -> Option<ComponentExtern<'a>> {
1035 self.0.types[self.0.index]
1036 .imports
1037 .get(name)
1038 .map(|e| ComponentExtern::new(engine, &self.0.instance(), e))
1039 }
1040
1041 /// Iterates over imports of the component
1042 pub fn imports<'a>(

Callers 1

Calls 4

newFunction · 0.50
mapMethod · 0.45
getMethod · 0.45
instanceMethod · 0.45

Tested by

no test coverage detected