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

Method push_export

crates/wasmtime/src/runtime/instance.rs:721–747  ·  view source on GitHub ↗
(
        &mut self,
        store: &StoreOpaque,
        item: &crate::runtime::vm::Export,
    )

Source from the content-addressed store, hash-verified

719 /// it contains a bunch of raw pointers.
720 #[cfg(feature = "component-model")]
721 pub(crate) fn push_export(
722 &mut self,
723 store: &StoreOpaque,
724 item: &crate::runtime::vm::Export,
725 ) -> Result<(), OutOfMemory> {
726 match item {
727 crate::runtime::vm::Export::Function(f) => {
728 self.functions.push(f.vmimport(store))?;
729 }
730 crate::runtime::vm::Export::Global(g) => {
731 self.globals.push(g.vmimport(store))?;
732 }
733 crate::runtime::vm::Export::Table(t) => {
734 self.tables.push(t.vmimport(store))?;
735 }
736 crate::runtime::vm::Export::Memory(m) => {
737 self.memories.push(m.vmimport(store))?;
738 }
739 crate::runtime::vm::Export::SharedMemory(_, vmimport) => {
740 self.memories.push(*vmimport)?;
741 }
742 crate::runtime::vm::Export::Tag(t) => {
743 self.tags.push(t.vmimport(store))?;
744 }
745 }
746 Ok(())
747 }
748
749 pub(crate) fn as_ref(&self) -> Imports<'_> {
750 Imports {

Callers 1

build_importsMethod · 0.45

Calls 3

OkFunction · 0.85
pushMethod · 0.45
vmimportMethod · 0.45

Tested by

no test coverage detected