Struct FrameStack

Source
pub struct FrameStack { /* private fields */ }
Expand description

The stack of call frames.

This struct is used within the Simulator to keep track of the frames of subroutine/trap calls. The amount of information it keeps track of depends on the debug_frames flag of the Simulator.

  • If the debug_frames flag is true, this keeps track of a Vec of Frames, which contains a large set of information about each frame.
  • If the debug_frames flag is false, this only keeps track of the number of frames traversed.

Implementations§

Source§

impl FrameStack

Source

pub fn get_trap_def(&self, vect: u8) -> Option<&ParameterList>

Gets the parameter definition for a trap (if it is defined).

Source

pub fn get_subroutine_def(&self, addr: u16) -> Option<&ParameterList>

Gets the parameter definition for a subroutine (if it is defined).

Note that the simulator does not automatically make subroutine definitions. Subroutine definitions have to be manually set by the FrameStack::set_subroutine_def method.

Source

pub fn set_subroutine_def(&mut self, addr: u16, params: ParameterList)

Sets the parameter definition for a subroutine.

This will overwrite any preexisting definition for a given subroutine.

Source

pub fn len(&self) -> u64

Gets the current number of frames entered.

Source

pub fn is_empty(&self) -> bool

Tests whether the frame stack is at top level execution.

Source

pub fn frames(&self) -> Option<&[Frame]>

Gets the list of current frames (if debug frames are enabled).

Trait Implementations§

Source§

impl Debug for FrameStack

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for FrameStack

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

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

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V