Returns the type of an item based on its index
(&self, index: EntityIndex)
| 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( |