Struct lucia_lang::lvm::Lvm
source · pub struct Lvm {
pub global_variables: HashMap<String, Value>,
pub builtin_variables: HashMap<String, Value>,
pub libs: HashMap<String, Value>,
pub current_frame: Option<NonNull<Frame>>,
/* private fields */
}Expand description
The Lucia virtual machine.
Fields§
§global_variables: HashMap<String, Value>§builtin_variables: HashMap<String, Value>§libs: HashMap<String, Value>§current_frame: Option<NonNull<Frame>>Implementations§
source§impl Lvm
impl Lvm
sourcepub fn call(&mut self, callee: Value, args: Vec<Value>) -> Result<Value>
pub fn call(&mut self, callee: Value, args: Vec<Value>) -> Result<Value>
Call a callable Value with arguments.
sourcepub fn set_global_variable(&mut self, key: String, value: Value)
pub fn set_global_variable(&mut self, key: String, value: Value)
Set the value of global variable.
sourcepub fn get_global_variable(&self, key: &str) -> Option<Value>
pub fn get_global_variable(&self, key: &str) -> Option<Value>
Get the value of global variable.
sourcepub fn get_builtin_variable(&self, name: &str) -> Option<Value>
pub fn get_builtin_variable(&self, name: &str) -> Option<Value>
Get the value of builtin variable.
sourcepub fn get_builtin_str(&mut self, key: &str) -> Value
pub fn get_builtin_str(&mut self, key: &str) -> Value
Get a builtin str.
sourcepub fn iter_table(&mut self, table_value: Value) -> Value
pub fn iter_table(&mut self, table_value: Value) -> Value
Return an iterator Value from a Table Value.
sourcepub fn new_gc_object<T: Trace + 'static>(&mut self, value: T) -> Gc<T>
pub fn new_gc_object<T: Trace + 'static>(&mut self, value: T) -> Gc<T>
Constructs a new Gc<T>.
pub fn new_str_value(&mut self, value: String) -> Value
pub fn new_table_value(&mut self, value: Table) -> Value
pub fn new_userdata_value(&mut self, value: UserData) -> Value
pub fn new_closure_value(&mut self, value: Closure) -> Value
pub fn new_ext_closure_value(&mut self, value: ExtClosure) -> Value
sourcepub fn traceback(&self) -> Vec<TracebackFrame>
pub fn traceback(&self) -> Vec<TracebackFrame>
Get the traceback info of current stack frame.