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

Method exports

crates/wasmtime/src/runtime/module.rs:819–833  ·  view source on GitHub ↗

Returns the list of exports that this [`Module`] has and will be available after instantiation. This function will return the type of each item that will be returned from [`Instance::exports`](crate::Instance::exports). Each entry in this list corresponds 1-to-1 with that list, and the entries here will indicate the name of the export along with the type of the export. # Examples Modules might

(
        &'module self,
    )

Source from the content-addressed store, hash-verified

817 /// # }
818 /// ```
819 pub fn exports<'module>(
820 &'module self,
821 ) -> impl ExactSizeIterator<Item = ExportType<'module>> + 'module {
822 let module = self.compiled_module().module();
823 let types = self.types();
824 let engine = self.engine();
825 module.exports.iter().map(move |(name, entity_index)| {
826 ExportType::new(
827 &module.strings[name],
828 module.type_of(*entity_index),
829 types,
830 engine,
831 )
832 })
833 }
834
835 /// Looks up an export in this [`Module`] by name.
836 ///

Calls 8

compiled_moduleMethod · 0.80
newFunction · 0.50
moduleMethod · 0.45
typesMethod · 0.45
engineMethod · 0.45
mapMethod · 0.45
iterMethod · 0.45
type_ofMethod · 0.45