Enum wasmtime_environ::wasmparser::types::Type
source · pub enum Type {
Sub(SubType),
Module(Box<ModuleType, Global>),
Instance(Box<InstanceType, Global>),
Component(Box<ComponentType, Global>),
ComponentInstance(Box<ComponentInstanceType, Global>),
ComponentFunc(ComponentFuncType),
Defined(ComponentDefinedType),
Resource(ResourceId),
}
Expand description
A unified type definition for validating WebAssembly modules and components.
Variants§
Sub(SubType)
The definition is for a sub type.
Module(Box<ModuleType, Global>)
The definition is for a core module type.
This variant is only supported when parsing a component.
Instance(Box<InstanceType, Global>)
The definition is for a core module instance type.
This variant is only supported when parsing a component.
Component(Box<ComponentType, Global>)
The definition is for a component type.
This variant is only supported when parsing a component.
ComponentInstance(Box<ComponentInstanceType, Global>)
The definition is for a component instance type.
This variant is only supported when parsing a component.
ComponentFunc(ComponentFuncType)
The definition is for a component function type.
This variant is only supported when parsing a component.
Defined(ComponentDefinedType)
The definition is for a component defined type.
This variant is only supported when parsing a component.
Resource(ResourceId)
This definition is for a resource type in the component model.
Each resource is identified by a unique identifier specified here.
Implementations§
source§impl Type
impl Type
sourcepub fn unwrap_func(&self) -> &FuncType
pub fn unwrap_func(&self) -> &FuncType
Converts the type to a core function type.
sourcepub fn unwrap_array(&self) -> &ArrayType
pub fn unwrap_array(&self) -> &ArrayType
Converts the type to an array type.
sourcepub fn unwrap_struct(&self) -> &StructType
pub fn unwrap_struct(&self) -> &StructType
Converts the type to a struct type.
sourcepub fn unwrap_module(&self) -> &ModuleType
pub fn unwrap_module(&self) -> &ModuleType
Converts the type to a core module type.
sourcepub fn unwrap_instance(&self) -> &InstanceType
pub fn unwrap_instance(&self) -> &InstanceType
Converts the type to a core module instance type.
sourcepub fn unwrap_component(&self) -> &ComponentType
pub fn unwrap_component(&self) -> &ComponentType
Converts the type to a component type.
sourcepub fn unwrap_component_instance(&self) -> &ComponentInstanceType
pub fn unwrap_component_instance(&self) -> &ComponentInstanceType
Converts the type to a component instance type.
sourcepub fn unwrap_component_func(&self) -> &ComponentFuncType
pub fn unwrap_component_func(&self) -> &ComponentFuncType
Converts the type to a component function type.
sourcepub fn unwrap_defined(&self) -> &ComponentDefinedType
pub fn unwrap_defined(&self) -> &ComponentDefinedType
Converts the type to a component defined type.
sourcepub fn unwrap_resource(&self) -> ResourceId
pub fn unwrap_resource(&self) -> ResourceId
Converts this type to a resource type, returning the corresponding id.