Struct wasmtime_environ::wasmparser::types::Types
source · pub struct Types { /* private fields */ }
Expand description
Represents the types known to a crate::Validator
once validation has completed.
The type information is returned via the crate::Validator::end
method.
Implementations§
source§impl Types
impl Types
sourcepub fn type_from_id(&self, id: TypeId) -> Option<&TypeDef>
pub fn type_from_id(&self, id: TypeId) -> Option<&TypeDef>
Gets a type based on its type id.
Returns None
if the type id is unknown.
sourcepub fn id_from_type_index(&self, index: u32) -> Option<TypeId>
pub fn id_from_type_index(&self, index: u32) -> Option<TypeId>
Gets a type id from a type index.
Returns None
if the type index is out of bounds.
sourcepub fn type_at(&self, index: u32) -> Option<&TypeDef>
pub fn type_at(&self, index: u32) -> Option<&TypeDef>
Gets a defined type at the given type index.
Returns None
if the index is out of bounds.
sourcepub fn func_type_at(&self, index: u32) -> Option<&FuncType>
pub fn func_type_at(&self, index: u32) -> Option<&FuncType>
Gets a defined core function type at the given type index.
Returns None
if the index is out of bounds.
Additionally, this method always returns None
for components
because core function types are never present in a component’s
type index space.
sourcepub fn type_count(&self) -> usize
pub fn type_count(&self) -> usize
Gets the count of defined types.
sourcepub fn table_at(&self, index: u32) -> Option<TableType>
pub fn table_at(&self, index: u32) -> Option<TableType>
Gets the type of a table at the given table index.
Returns None
if the index is out of bounds.
sourcepub fn table_count(&self) -> usize
pub fn table_count(&self) -> usize
Gets the count of imported and defined tables.
sourcepub fn memory_at(&self, index: u32) -> Option<MemoryType>
pub fn memory_at(&self, index: u32) -> Option<MemoryType>
Gets the type of a memory at the given memory index.
Returns None
if the index is out of bounds.
sourcepub fn memory_count(&self) -> usize
pub fn memory_count(&self) -> usize
Gets the count of imported and defined memories.
sourcepub fn global_at(&self, index: u32) -> Option<GlobalType>
pub fn global_at(&self, index: u32) -> Option<GlobalType>
Gets the type of a global at the given global index.
Returns None
if the index is out of bounds.
sourcepub fn global_count(&self) -> usize
pub fn global_count(&self) -> usize
Gets the count of imported and defined globals.
sourcepub fn tag_at(&self, index: u32) -> Option<&FuncType>
pub fn tag_at(&self, index: u32) -> Option<&FuncType>
Gets the type of a tag at the given tag index.
Returns None
if the index is out of bounds.
sourcepub fn function_at(&self, index: u32) -> Option<&FuncType>
pub fn function_at(&self, index: u32) -> Option<&FuncType>
Gets the type of a core function at the given function index.
Returns None
if the index is out of bounds or when parsing
a component and the function at the given index is not a core
function type.
sourcepub fn component_function_at(&self, index: u32) -> Option<&ComponentFuncType>
pub fn component_function_at(&self, index: u32) -> Option<&ComponentFuncType>
Gets the type of a component function at the given function index.
Returns None
if the index is out of bounds or if the function at
the given index is not a component function type.
sourcepub fn function_count(&self) -> usize
pub fn function_count(&self) -> usize
Gets the count of imported and defined functions.
The count also includes aliased functions in components.
sourcepub fn element_at(&self, index: u32) -> Option<Type>
pub fn element_at(&self, index: u32) -> Option<Type>
Gets the type of an element segment at the given element segment index.
Returns None
if the index is out of bounds.
sourcepub fn element_count(&self) -> usize
pub fn element_count(&self) -> usize
Gets the count of element segments.
sourcepub fn module_at(&self, index: u32) -> Option<&ModuleType>
pub fn module_at(&self, index: u32) -> Option<&ModuleType>
Gets the type of a module at the given module index.
Returns None
if the index is out of bounds.
sourcepub fn module_count(&self) -> usize
pub fn module_count(&self) -> usize
Gets the count of imported, exported, or aliased modules.
sourcepub fn component_at(&self, index: u32) -> Option<&ComponentType>
pub fn component_at(&self, index: u32) -> Option<&ComponentType>
Gets the type of a component at the given component index.
Returns None
if the index is out of bounds.
sourcepub fn component_count(&self) -> usize
pub fn component_count(&self) -> usize
Gets the count of imported, exported, or aliased components.
sourcepub fn instance_at(&self, index: u32) -> Option<&InstanceType>
pub fn instance_at(&self, index: u32) -> Option<&InstanceType>
Gets the type of an instance at the given instance index.
Returns None
if the index is out of bounds or if the instance is not
a component instance.
sourcepub fn module_instance_at(&self, index: u32) -> Option<&ModuleType>
pub fn module_instance_at(&self, index: u32) -> Option<&ModuleType>
Gets the type of a core module instance at the given instance index.
Returns None
if the index is out of bounds or if the instance is not
a module instance.
sourcepub fn instance_count(&self) -> usize
pub fn instance_count(&self) -> usize
Gets the count of imported, exported, or aliased instances.
sourcepub fn value_at(&self, index: u32) -> Option<InterfaceTypeRef>
pub fn value_at(&self, index: u32) -> Option<InterfaceTypeRef>
Gets the type of a value at the given value index.
Returns None
if the index is out of bounds.
sourcepub fn value_count(&self) -> usize
pub fn value_count(&self) -> usize
Gets the count of imported, exported, or aliased values.