Struct lovm2_core::vm::Context [−][src]
The state of the virtual machine
This contains all necessary runtime data and gets shared with objects that
implement CallProtocol
as well as interrupts.
Implementations
impl Context
[src]
pub fn new() -> Self
[src]
pub fn lookup_code_object(&self, name: &Variable) -> Lovm2Result<CallableRef>
[src]
Try to resolve the given name to a callable
pub fn stack_mut(&mut self) -> &mut Vec<Value>
[src]
Get a mutable reference to the value stack itself
pub fn lstack_mut(&mut self) -> &mut Vec<Frame>
[src]
Get a mutable reference to the value lstack itself
pub fn frame_mut(&mut self) -> Lovm2Result<&mut Frame>
[src]
Get a mutable reference to the last stack frame
pub fn set_global<T>(&mut self, var: T, val: Value) where
T: AsRef<str>,
[src]
T: AsRef<str>,
Set value of a global variable
pub fn push_frame(&mut self, argn: u8)
[src]
Create a frame on the callstack
pub fn pop_frame(&mut self)
[src]
Remove a frame from the callstack
pub fn push_value(&mut self, value: Value)
[src]
Put a new value on the stack
pub fn pop_value(&mut self) -> Lovm2Result<Value>
[src]
Remove the last value on stack
pub fn last_value_mut(&mut self) -> Lovm2Result<&mut Value>
[src]
Get a mutable reference to the last value on stack
pub fn value_of<T>(&self, var: T) -> Lovm2Result<&Value> where
T: AsRef<str>,
[src]
T: AsRef<str>,
Lookup a global value
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Context
[src]
impl !Send for Context
[src]
impl !Sync for Context
[src]
impl Unpin for Context
[src]
impl !UnwindSafe for Context
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,