pub struct VM { /* private fields */ }Implementations§
Source§impl VM
impl VM
pub fn new() -> Self
pub fn with_config(config: &LustConfig) -> Self
pub fn with_current<F, R>(f: F) -> Result<R, String>
pub fn load_functions(&mut self, functions: Vec<Function>)
pub fn register_structs(&mut self, defs: &HashMap<String, StructDef>)
pub fn instantiate_struct( &self, struct_name: &str, fields: Vec<(Rc<String>, Value)>, ) -> Result<Value>
pub fn register_trait_impl(&mut self, type_name: String, trait_name: String)
pub fn register_native(&mut self, name: impl Into<String>, value: Value)
pub fn register_exported_native<F>(&mut self, export: NativeExport, func: F)
pub fn exported_natives(&self) -> &[NativeExport]
pub fn take_exported_natives(&mut self) -> Vec<NativeExport>
pub fn clear_native_functions(&mut self)
pub fn get_global(&self, name: &str) -> Option<Value>
pub fn set_global(&mut self, name: impl Into<String>, value: Value)
pub fn call(&mut self, function_name: &str, args: Vec<Value>) -> Result<Value>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for VM
impl !RefUnwindSafe for VM
impl !Send for VM
impl !Sync for VM
impl Unpin for VM
impl !UnwindSafe for VM
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more