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

Method import

crates/environ/src/module.rs:504–512  ·  view source on GitHub ↗

Get this module's `i`th import.

(&self, i: usize)

Source from the content-addressed store, hash-verified

502
503 /// Get this module's `i`th import.
504 pub fn import(&self, i: usize) -> Option<(&str, &str, EntityType)> {
505 match self.initializers.get(i)? {
506 Initializer::Import { name, field, index } => Some((
507 &self.strings[name],
508 &self.strings[field],
509 self.type_of(*index),
510 )),
511 }
512 }
513
514 /// Returns the type of an item based on its index
515 pub fn type_of(&self, index: EntityIndex) -> EntityType {

Callers 5

importsMethod · 0.45
encodeMethod · 0.45
wasmMethod · 0.45
to_wasm_binaryMethod · 0.45

Calls 2

getMethod · 0.45
type_ofMethod · 0.45

Tested by

no test coverage detected