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

Method _get_export

crates/wasmtime/src/runtime/component/instance.rs:298–319  ·  view source on GitHub ↗
(
        &self,
        store: &StoreOpaque,
        instance: Option<&ComponentExportIndex>,
        name: &str,
    )

Source from the content-addressed store, hash-verified

296 }
297
298 fn _get_export(
299 &self,
300 store: &StoreOpaque,
301 instance: Option<&ComponentExportIndex>,
302 name: &str,
303 ) -> Option<(ComponentItem, ComponentExportIndex)> {
304 let data = self.id().get(store);
305 let component = data.component();
306 let index = component.lookup_export_index(instance, name)?;
307 let item = ComponentItem::from_export(
308 &store.engine(),
309 &component.env_component().export_items[index],
310 &InstanceType::new(data),
311 );
312 Some((
313 item,
314 ComponentExportIndex {
315 id: data.component().id(),
316 index,
317 },
318 ))
319 }
320
321 /// A methods similar to [`Component::get_export_index`] except for this
322 /// instance.

Callers 1

get_exportMethod · 0.45

Calls 7

lookup_export_indexMethod · 0.80
env_componentMethod · 0.80
newFunction · 0.50
getMethod · 0.45
idMethod · 0.45
componentMethod · 0.45
engineMethod · 0.45

Tested by

no test coverage detected