Struct VariableManagerImpl

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

Concrete implementation of variable management for the VM

Provides array-based storage for local and global variables with indexed access and modification capabilities.

Implementations§

Source§

impl VariableManagerImpl

Source

pub fn new() -> Self

Creates a new variable manager with empty variable storage

Initializes both local and global variable storage with 32 slots each, all set to Value::Undefined.

Source

pub fn locals(&self) -> &[Value]

Source

pub fn locals_mut(&mut self) -> &mut [Value]

Source

pub fn globals(&self) -> &[Value]

Source

pub fn globals_mut(&mut self) -> &mut [Value]

Trait Implementations§

Source§

impl VariableManager for VariableManagerImpl

Source§

fn get_local(&self, idx: usize) -> Option<&Value>

Gets a local variable by index Read more
Source§

fn set_local(&mut self, idx: usize, value: Value)

Sets a local variable by index Read more
Source§

fn get_global(&self, idx: usize) -> Option<&Value>

Gets a global variable by index Read more
Source§

fn set_global(&mut self, idx: usize, value: Value)

Sets a global variable by index Read more
Source§

fn get_local_mut(&mut self, idx: usize) -> Option<&mut Value>

Gets a mutable reference to a local variable by index Read more
Source§

fn get_global_mut(&mut self, idx: usize) -> Option<&mut Value>

Gets a mutable reference to a global variable by index Read more
Source§

fn get_argument(&self, idx: usize) -> Option<&Value>

Gets a function argument by index Read more
Source§

fn set_argument(&mut self, idx: usize, value: Value)

Sets a function argument by index 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.