Struct parity_wasm::elements::FuncBody
source · [−]pub struct FuncBody { /* private fields */ }
Expand description
Function body definition.
Implementations
sourceimpl 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).
Trait Implementations
sourceimpl Deserialize for FuncBody
impl Deserialize for FuncBody
impl StructuralPartialEq for FuncBody
Auto Trait Implementations
impl RefUnwindSafe for FuncBody
impl Send for FuncBody
impl Sync for FuncBody
impl Unpin for FuncBody
impl UnwindSafe for FuncBody
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more