Struct lovm2_core::vm::Context[][src]

pub struct Context { /* fields omitted */ }

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]

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]

Lookup a global value

Trait Implementations

impl Debug for Context[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.