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) -> CoreResult<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 export_prefix(&self) -> Option<String>
pub fn register_exported_native<F>(&mut self, export: NativeExport, func: F)
pub fn register_type_stubs(&mut self, stubs: Vec<ModuleStub>)
pub fn take_type_stubs(&mut self) -> Vec<ModuleStub>
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 global_names(&self) -> Vec<String>
pub fn globals_snapshot(&self) -> Vec<(String, 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>
pub fn function_value(&self, function_name: &str) -> Option<Value>
pub fn function_name(&self, index: usize) -> Option<&str>
pub fn fail_task_handle( &mut self, handle: TaskHandle, error: LustError, ) -> Result<()>
Source§impl VM
impl VM
pub fn spawn_task_value( &mut self, func: Value, args: Vec<Value>, ) -> Result<TaskHandle>
pub fn resume_task_handle( &mut self, handle: TaskHandle, resume_value: Option<Value>, ) -> Result<()>
pub fn get_task_instance(&self, handle: TaskHandle) -> Result<&TaskInstance>
pub fn current_task_handle(&self) -> Option<TaskHandle>
pub fn create_native_future_task(&mut self) -> TaskHandle
pub fn complete_native_future_task( &mut self, handle: TaskHandle, outcome: Result<Value, String>, ) -> Result<()>
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