Struct walrus::LocalFunction
source · pub struct LocalFunction {
pub args: Vec<LocalId>,
pub instruction_mapping: Vec<(usize, InstrLocId)>,
pub original_range: Option<Range<usize>>,
/* private fields */
}
Expand description
A function defined locally within the wasm module.
Fields§
§args: Vec<LocalId>
Arguments to this function, and the locals that they’re assigned to.
instruction_mapping: Vec<(usize, InstrLocId)>
InstrSeqId list mapping to original instruction
original_range: Option<Range<usize>>
Original function binary range.
Implementations§
source§impl LocalFunction
impl LocalFunction
sourcepub fn entry_block(&self) -> InstrSeqId
pub fn entry_block(&self) -> InstrSeqId
Get the id of this function’s entry block.
sourcepub fn block(&self, id: InstrSeqId) -> &InstrSeq
pub fn block(&self, id: InstrSeqId) -> &InstrSeq
Get the block associated with the given id.
sourcepub fn block_mut(&mut self, id: InstrSeqId) -> &mut InstrSeq
pub fn block_mut(&mut self, id: InstrSeqId) -> &mut InstrSeq
Get the block associated with the given id.
sourcepub fn builder(&self) -> &FunctionBuilder
pub fn builder(&self) -> &FunctionBuilder
Get access to a FunctionBuilder
to continue adding instructions to
this function.
sourcepub fn builder_mut(&mut self) -> &mut FunctionBuilder
pub fn builder_mut(&mut self) -> &mut FunctionBuilder
Get access to a FunctionBuilder
to continue adding instructions to
this function.
sourcepub fn is_const(&self) -> bool
pub fn is_const(&self) -> bool
Is this function’s body a constant instruction?
sourcepub fn used_data_segments(&self) -> HashSet<Id<Data>, BuildIdHasher>
pub fn used_data_segments(&self) -> HashSet<Id<Data>, BuildIdHasher>
Collect the set of data segments that are used in this function via
memory.init
or data.drop
instructions.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for LocalFunction
impl RefUnwindSafe for LocalFunction
impl Send for LocalFunction
impl Sync for LocalFunction
impl Unpin for LocalFunction
impl UnwindSafe for LocalFunction
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more