Trait wasmparser::ModuleArity
source · pub trait ModuleArity {
// Required methods
fn sub_type_at(&self, type_idx: u32) -> Option<&SubType>;
fn tag_type_arity(&self, at: u32) -> Option<(u32, u32)>;
fn type_index_of_function(&self, function_idx: u32) -> Option<u32>;
fn func_type_of_cont_type(&self, c: &ContType) -> Option<&FuncType>;
fn sub_type_of_ref_type(&self, rt: &RefType) -> Option<&SubType>;
fn control_stack_height(&self) -> u32;
fn label_block(&self, depth: u32) -> Option<(BlockType, FrameKind)>;
// Provided methods
fn sub_type_arity(&self, t: &SubType) -> Option<(u32, u32)> { ... }
fn block_type_arity(&self, ty: BlockType) -> Option<(u32, u32)> { ... }
}
Expand description
To compute the arity (param and result counts) of “variable-arity” operators, the operator_arity macro needs information about the module’s types and the current control stack. The ModuleArity trait exposes this information.
Required Methods§
sourcefn sub_type_at(&self, type_idx: u32) -> Option<&SubType>
fn sub_type_at(&self, type_idx: u32) -> Option<&SubType>
Type with given index
sourcefn tag_type_arity(&self, at: u32) -> Option<(u32, u32)>
fn tag_type_arity(&self, at: u32) -> Option<(u32, u32)>
Arity (param and result counts) of tag with given index
sourcefn type_index_of_function(&self, function_idx: u32) -> Option<u32>
fn type_index_of_function(&self, function_idx: u32) -> Option<u32>
Type index of function with given index
sourcefn func_type_of_cont_type(&self, c: &ContType) -> Option<&FuncType>
fn func_type_of_cont_type(&self, c: &ContType) -> Option<&FuncType>
Function type for a given continuation type
sourcefn sub_type_of_ref_type(&self, rt: &RefType) -> Option<&SubType>
fn sub_type_of_ref_type(&self, rt: &RefType) -> Option<&SubType>
Sub type for a given reference type
sourcefn control_stack_height(&self) -> u32
fn control_stack_height(&self) -> u32
Current height of control stack