FrameStateSlot

Struct FrameStateSlot 

Source
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>

Source

pub fn parse(descriptor: &'a [u8]) -> Result<FrameStateSlot<'a>>

Parse a slot descriptor.

This parses the descriptor bytes as provided by FrameTable::frame_descriptor.

Source

pub fn func_key(&self) -> FuncKey

Get the FuncKey for the function that produced this frame slot.

Source

pub fn locals( &self, ) -> impl Iterator<Item = (FrameStateSlotOffset, FrameValType)>

Get the local offsets and types.

Source

pub fn local( &self, index: usize, ) -> Option<(FrameStateSlotOffset, FrameValType)>

Get the type and offset for a given local.

Source

pub fn num_locals(&self) -> usize

Get the number of locals in the frame.

Source

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.

Source

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.