Struct wasmi_validation::util::Locals [−][src]
pub struct Locals<'a> { /* fields omitted */ }
Locals are the concatenation of a slice of function parameters with function declared local variables.
Local variables are given in the form of groups represented by pairs of a value_type and a count.
Implementations
impl<'a> Locals<'a>
[src]
impl<'a> Locals<'a>
[src]pub fn new(
params: &'a [ValueType],
local_groups: &'a [Local]
) -> Result<Locals<'a>, Error>
[src]
params: &'a [ValueType],
local_groups: &'a [Local]
) -> Result<Locals<'a>, Error>
Create a new wrapper around declared variables and parameters.
pub fn param_count(&self) -> u32
[src]
Returns parameter count.
pub fn count(&self) -> u32
[src]
Returns total count of all declared locals and paramaterers.
pub fn type_of_local(&self, idx: u32) -> Result<ValueType, Error>
[src]
Returns the type of a local variable (either a declared local or a param).
Returns Err
in the case of overflow or when idx falls out of range.