pub struct FrameStateSlot<'a> { /* private fields */ }
Expand description
Parser for a frame state slot descriptor.
This provides the ability to extract offsets and types for locals and for the stack given a stack shape.
Implementations§
Source§impl<'a> FrameStateSlot<'a>
impl<'a> FrameStateSlot<'a>
Sourcepub fn parse(descriptor: &'a [u8]) -> Result<FrameStateSlot<'a>>
pub fn parse(descriptor: &'a [u8]) -> Result<FrameStateSlot<'a>>
Parse a slot descriptor.
This parses the descriptor bytes as provided by
FrameTable::frame_descriptor
.
Sourcepub fn func_key(&self) -> FuncKey
pub fn func_key(&self) -> FuncKey
Get the FuncKey for the function that produced this frame slot.
Sourcepub fn locals(
&self,
) -> impl Iterator<Item = (FrameStateSlotOffset, FrameValType)>
pub fn locals( &self, ) -> impl Iterator<Item = (FrameStateSlotOffset, FrameValType)>
Get the local offsets and types.
Sourcepub fn local(
&self,
index: usize,
) -> Option<(FrameStateSlotOffset, FrameValType)>
pub fn local( &self, index: usize, ) -> Option<(FrameStateSlotOffset, FrameValType)>
Get the type and offset for a given local.
Sourcepub fn num_locals(&self) -> usize
pub fn num_locals(&self) -> usize
Get the number of locals in the frame.
Sourcepub fn stack(
&self,
shape: FrameStackShape,
) -> impl Iterator<Item = (FrameStateSlotOffset, FrameValType)>
pub fn stack( &self, shape: FrameStackShape, ) -> impl Iterator<Item = (FrameStateSlotOffset, FrameValType)>
Get the offsets and types for operand stack values, from top of stack (most recently pushed) down.
Sourcepub fn stack_and_locals(
&self,
shape: FrameStackShape,
) -> impl Iterator<Item = (FrameStateSlotOffset, FrameValType)> + '_
pub fn stack_and_locals( &self, shape: FrameStackShape, ) -> impl Iterator<Item = (FrameStateSlotOffset, FrameValType)> + '_
Returns an iterator over all storage in this frame.
Auto Trait Implementations§
impl<'a> Freeze for FrameStateSlot<'a>
impl<'a> RefUnwindSafe for FrameStateSlot<'a>
impl<'a> Send for FrameStateSlot<'a>
impl<'a> Sync for FrameStateSlot<'a>
impl<'a> Unpin for FrameStateSlot<'a>
impl<'a> UnwindSafe for FrameStateSlot<'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