pub struct Instructions<'a> { /* private fields */ }Expand description
A sequence of Wasm instructions which may be instrumented.
Implementations§
Source§impl<'a> Instructions<'a>
impl<'a> Instructions<'a>
pub fn new( instructions: Vec<(Operator<'a>, usize)>, locals_start: usize, save_offsets: bool, ) -> Self
Sourcepub fn get_flags(&self) -> Option<&[InstrumentationFlag<'a>]>
pub fn get_flags(&self) -> Option<&[InstrumentationFlag<'a>]>
Get array of instrumentation flags.
Sourcepub fn get_ops_mut(&mut self) -> Result<&mut Vec<Operator<'a>>>
pub fn get_ops_mut(&mut self) -> Result<&mut Vec<Operator<'a>>>
Directly mutating the instructions will likely invalidate the instruction flags, so this will Error if the instructions have been instrumented.
pub fn get_instr_flag(&self, idx: usize) -> Option<&InstrumentationFlag<'a>>
pub fn push(&mut self, op: Operator<'a>)
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn add_instr(&mut self, index: usize, op: Operator<'a>) -> bool
pub fn current_mode(&self, index: usize) -> Option<InstrumentationMode>
pub fn set_current_mode(&mut self, index: usize, mode: InstrumentationMode)
pub fn finish_instr(&mut self, index: usize)
pub fn instr_len(&self, index: usize) -> usize
pub fn set_alternate(&mut self, index: usize, alternate: InjectedInstrs<'a>)
pub fn set_block_alt(&mut self, index: usize, block_alt: InjectedInstrs<'a>)
pub fn append_to_tag(&mut self, index: usize, data: Vec<u8>)
pub fn clear_instr(&mut self, idx: usize, mode: InstrumentationMode)
pub fn lookup_pc_offset_for(&self, instr_idx: usize) -> Option<usize>
Trait Implementations§
Source§impl<'a> Clone for Instructions<'a>
impl<'a> Clone for Instructions<'a>
Source§impl<'a> Debug for Instructions<'a>
impl<'a> Debug for Instructions<'a>
Auto Trait Implementations§
impl<'a> Freeze for Instructions<'a>
impl<'a> RefUnwindSafe for Instructions<'a>
impl<'a> Send for Instructions<'a>
impl<'a> Sync for Instructions<'a>
impl<'a> Unpin for Instructions<'a>
impl<'a> UnsafeUnpin for Instructions<'a>
impl<'a> UnwindSafe for Instructions<'a>
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