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

Method type_of

crates/environ/src/module.rs:515–523  ·  view source on GitHub ↗

Returns the type of an item based on its index

(&self, index: EntityIndex)

Source from the content-addressed store, hash-verified

513
514 /// Returns the type of an item based on its index
515 pub fn type_of(&self, index: EntityIndex) -> EntityType {
516 match index {
517 EntityIndex::Global(i) => EntityType::Global(self.globals[i]),
518 EntityIndex::Table(i) => EntityType::Table(self.tables[i]),
519 EntityIndex::Memory(i) => EntityType::Memory(self.memories[i]),
520 EntityIndex::Function(i) => EntityType::Function(self.functions[i].signature),
521 EntityIndex::Tag(i) => EntityType::Tag(self.tags[i]),
522 }
523 }
524
525 /// Appends a new tag to this module with the given type information.
526 pub fn push_tag(

Callers 5

exportsMethod · 0.45
get_exportMethod · 0.45
moduleMethod · 0.45
importsMethod · 0.45
importMethod · 0.45

Calls 5

GlobalClass · 0.70
TableClass · 0.70
MemoryClass · 0.70
FunctionClass · 0.70
TagClass · 0.70

Tested by

no test coverage detected