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§
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>
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)
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.