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

Method imports

crates/environ/src/module.rs:494–501  ·  view source on GitHub ↗

Returns an iterator of all the imports in this module, along with their module name, field name, and type that's being imported.

(&self)

Source from the content-addressed store, hash-verified

492 /// Returns an iterator of all the imports in this module, along with their
493 /// module name, field name, and type that's being imported.
494 pub fn imports(&self) -> impl ExactSizeIterator<Item = (&str, &str, EntityType)> {
495 let pool = &self.strings;
496 self.initializers.iter().map(move |i| match i {
497 Initializer::Import { name, field, index } => {
498 (&pool[name], &pool[field], self.type_of(*index))
499 }
500 })
501 }
502
503 /// Get this module's `i`th import.
504 pub fn import(&self, i: usize) -> Option<(&str, &str, EntityType)> {

Callers

nothing calls this directly

Calls 3

mapMethod · 0.45
iterMethod · 0.45
type_ofMethod · 0.45

Tested by

no test coverage detected