Struct parity_wasm::elements::FuncBody
source · pub struct FuncBody { /* private fields */ }
Expand description
Function body definition.
Implementations§
source§impl FuncBody
impl FuncBody
sourcepub fn new(locals: Vec<Local>, instructions: Instructions) -> Self
pub fn new(locals: Vec<Local>, instructions: Instructions) -> Self
New function body with given locals
and instructions
.
sourcepub fn code(&self) -> &Instructions
pub fn code(&self) -> &Instructions
Instruction list of the function body. Minimal instruction list
is just &[Instruction::End]
sourcepub fn locals_mut(&mut self) -> &mut Vec<Local>
pub fn locals_mut(&mut self) -> &mut Vec<Local>
Locals declared in function body (mutable).
sourcepub fn code_mut(&mut self) -> &mut Instructions
pub fn code_mut(&mut self) -> &mut Instructions
Instruction list of the function body (mutable).