Runner

Trait Runner 

Source
pub trait Runner<'vm>: ResolveValue {
Show 35 methods // Required methods fn store_value(&mut self, value: StackValue); fn pop(&mut self) -> Option<StackValue>; fn next_value<T: Display>(&mut self, location: T) -> StackValue; fn options(&self) -> &VMOptions; fn update_scope<F>( &mut self, index: usize, update: F, ) -> Result<(), VMError> where F: FnMut(&mut Scope<'vm>) -> Result<(), VMError>; fn get_module_clone( &mut self, module: &'vm str, ) -> Option<ResolvedModule<'vm>>; fn load_mut(&mut self, name: &'vm str) -> Result<(), VMError>; fn load_let(&mut self, name: &'vm str) -> Result<(), VMError>; fn find_variable( &self, name: &'vm str, frame: &CallFrame<'vm>, parent: Option<usize>, ) -> Option<Option<usize>>; fn call_frame(&mut self, scope_index: usize) -> Result<(), VMError>; fn call_frame_memo(&mut self, scope_index: usize) -> Result<(), VMError>; fn persist_scope(&mut self, var: &'vm str) -> Option<VMError>; fn goto(&mut self, scope_id: usize, pc: usize) -> Result<(), VMError>; fn send(&mut self, args: usize) -> Result<(), VMError>; fn receive(&mut self, args: usize) -> Result<(), VMError>; fn broadcast(&mut self, args: BroadcastArgs) -> Result<(), VMError>; fn spawn( &mut self, scope_id: usize, timeout: Option<usize>, ) -> Result<(), VMError>; fn get_variable(&mut self, name: &'vm str); fn get_mutable_variable(&mut self, name: &'vm str); fn get_variable_reference(&mut self, name: &'vm str); fn call( &mut self, module: ResolvedModule<'vm>, func: &'vm str, args: usize, ) -> Result<Value, VMError>; fn call_extension( &mut self, module: ResolvedModule<'vm>, func: &'vm str, args: usize, ) -> Result<Value, VMError>; fn call_mutable_extension( &mut self, module: ResolvedModule<'vm>, func: &'vm str, args: usize, ) -> Result<Option<Value>, VMError>; fn vm_extension( &mut self, module: ResolvedModule<'vm>, func: &'vm str, args: usize, ) -> Result<Value, VMError>; // Provided methods fn set_this(&mut self, mutable: bool) -> Result<(), VMError> { ... } fn apply_unary( &mut self, unary_operation: UnaryOperation, val: Rc<RefCell<Value>>, ) { ... } fn handle_unary(&mut self, op: UnaryOperation) { ... } fn apply_binary( &mut self, binary_operation: BinaryOperation, lhs: Rc<RefCell<Value>>, rhs: Rc<RefCell<Value>>, ) { ... } fn handle_binary(&mut self, op: BinaryOperation) { ... } fn handle_binary_assign(&mut self, op: BinaryOperation) { ... } fn next_resolved_value<T: Display>( &mut self, location: T, ) -> Rc<RefCell<Value>> { ... } fn resolve_args(&mut self, count: usize) -> Vec<Rc<RefCell<Value>>> { ... } fn process_core_instruction( &mut self, instruction: Instruction<'vm>, ) -> VMState { ... } fn instance_get(&mut self, multiple: bool) { ... } fn instance_set(&mut self, mutable: bool) { ... }
}

Required Methods§

Source

fn store_value(&mut self, value: StackValue)

Source

fn pop(&mut self) -> Option<StackValue>

Source

fn next_value<T: Display>(&mut self, location: T) -> StackValue

Source

fn options(&self) -> &VMOptions

Source

fn update_scope<F>(&mut self, index: usize, update: F) -> Result<(), VMError>
where F: FnMut(&mut Scope<'vm>) -> Result<(), VMError>,

Source

fn get_module_clone(&mut self, module: &'vm str) -> Option<ResolvedModule<'vm>>

Source

fn load_mut(&mut self, name: &'vm str) -> Result<(), VMError>

Source

fn load_let(&mut self, name: &'vm str) -> Result<(), VMError>

Source

fn find_variable( &self, name: &'vm str, frame: &CallFrame<'vm>, parent: Option<usize>, ) -> Option<Option<usize>>

Source

fn call_frame(&mut self, scope_index: usize) -> Result<(), VMError>

Source

fn call_frame_memo(&mut self, scope_index: usize) -> Result<(), VMError>

Source

fn persist_scope(&mut self, var: &'vm str) -> Option<VMError>

Source

fn goto(&mut self, scope_id: usize, pc: usize) -> Result<(), VMError>

Source

fn send(&mut self, args: usize) -> Result<(), VMError>

Source

fn receive(&mut self, args: usize) -> Result<(), VMError>

Source

fn broadcast(&mut self, args: BroadcastArgs) -> Result<(), VMError>

Source

fn spawn( &mut self, scope_id: usize, timeout: Option<usize>, ) -> Result<(), VMError>

Source

fn get_variable(&mut self, name: &'vm str)

Source

fn get_mutable_variable(&mut self, name: &'vm str)

Source

fn get_variable_reference(&mut self, name: &'vm str)

Source

fn call( &mut self, module: ResolvedModule<'vm>, func: &'vm str, args: usize, ) -> Result<Value, VMError>

Source

fn call_extension( &mut self, module: ResolvedModule<'vm>, func: &'vm str, args: usize, ) -> Result<Value, VMError>

Source

fn call_mutable_extension( &mut self, module: ResolvedModule<'vm>, func: &'vm str, args: usize, ) -> Result<Option<Value>, VMError>

Source

fn vm_extension( &mut self, module: ResolvedModule<'vm>, func: &'vm str, args: usize, ) -> Result<Value, VMError>

Provided Methods§

Source

fn set_this(&mut self, mutable: bool) -> Result<(), VMError>

Source

fn apply_unary( &mut self, unary_operation: UnaryOperation, val: Rc<RefCell<Value>>, )

Source

fn handle_unary(&mut self, op: UnaryOperation)

Source

fn apply_binary( &mut self, binary_operation: BinaryOperation, lhs: Rc<RefCell<Value>>, rhs: Rc<RefCell<Value>>, )

Source

fn handle_binary(&mut self, op: BinaryOperation)

Source

fn handle_binary_assign(&mut self, op: BinaryOperation)

Source

fn next_resolved_value<T: Display>(&mut self, location: T) -> Rc<RefCell<Value>>

Source

fn resolve_args(&mut self, count: usize) -> Vec<Rc<RefCell<Value>>>

Source

fn process_core_instruction(&mut self, instruction: Instruction<'vm>) -> VMState

Source

fn instance_get(&mut self, multiple: bool)

Source

fn instance_set(&mut self, mutable: bool)

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<'vm> Runner<'vm> for VM<'vm>