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

Method get_export

crates/wasmtime/src/runtime/component/instance.rs:289–296  ·  view source on GitHub ↗

A methods similar to [`Component::get_export`] except for this instance. This method will lookup the `name` provided within the `instance` provided and return a [`ComponentItem`] describing the export, and [`ComponentExportIndex`] which can be passed other `get_*` functions like [`Instance::get_func`]. The [`ComponentItem`] is more expensive to compute than the [`ComponentExportIndex`]. If you a

(
        &self,
        mut store: impl AsContextMut,
        instance: Option<&ComponentExportIndex>,
        name: &str,
    )

Source from the content-addressed store, hash-verified

287 ///
288 /// Panics if `store` does not own this instance.
289 pub fn get_export(
290 &self,
291 mut store: impl AsContextMut,
292 instance: Option<&ComponentExportIndex>,
293 name: &str,
294 ) -> Option<(ComponentItem, ComponentExportIndex)> {
295 self._get_export(store.as_context_mut().0, instance, name)
296 }
297
298 fn _get_export(
299 &self,

Callers

nothing calls this directly

Calls 2

_get_exportMethod · 0.45
as_context_mutMethod · 0.45

Tested by

no test coverage detected