[−][src]Struct dyon::runtime::Runtime
Stores data needed for running a Dyon program.
Fields
stack: Vec<Variable>
Stores variables on the stack.
call_stack: Vec<Call>
name, file, stack_len, local_len.
local_stack: Vec<(Arc<String>, usize)>
Stores stack of locals.
current_stack: Vec<(Arc<String>, usize)>
Stores stack of current objects.
When a current object is used, the runtime searches backwards until it finds the last current variable with the name.
Methods
impl Runtime
[src]
pub fn new() -> Runtime
[src]
Creates a new Runtime.
pub fn pop<T: PopVariable>(&mut self) -> Result<T, String>
[src]
Pops variable from stack.
pub fn pop_vec4<T: ConvertVec4>(&mut self) -> Result<T, String>
[src]
Pops 4D vector from stack.
pub fn pop_mat4<T: ConvertMat4>(&mut self) -> Result<T, String>
[src]
Pops 4D matrix from stack.
pub fn var<T: PopVariable>(&self, var: &Variable) -> Result<T, String>
[src]
Gets variable.
pub fn var_vec4<T: ConvertVec4>(&self, var: &Variable) -> Result<T, String>
[src]
Gets 4D vector.
pub fn var_mat4<T: ConvertMat4>(&self, var: &Variable) -> Result<T, String>
[src]
Gets 4D matrix.
pub fn push<T: PushVariable>(&mut self, val: T)
[src]
Push value to stack.
pub fn push_vec4<T: ConvertVec4>(&mut self, val: T)
[src]
Push Vec4 to stack.
pub fn push_mat4<T: ConvertMat4>(&mut self, val: T)
[src]
Push Mat4 to stack.
pub fn push_rust<T: 'static>(&mut self, val: T)
[src]
Pushes Rust object to stack.
pub fn expected(&self, var: &Variable, ty: &str) -> String
[src]
Generates error message that a certain type was expected.
pub fn resolve<'a>(&'a self, var: &'a Variable) -> &'a Variable
[src]
Resolves a variable reference if any, getting a pointer to the variable on the stack.
pub fn run(&mut self, module: &Arc<Module>) -> Result<(), String>
[src]
Run main
function in a module.
pub fn go(
&mut self,
go: &Go,
module: &Arc<Module>
) -> Result<(Option<Variable>, Flow), String>
[src]
&mut self,
go: &Go,
module: &Arc<Module>
) -> Result<(Option<Variable>, Flow), String>
Start a new thread and return the handle.
pub fn call_closure(
&mut self,
call: &CallClosure,
module: &Arc<Module>
) -> Result<(Option<Variable>, Flow), String>
[src]
&mut self,
call: &CallClosure,
module: &Arc<Module>
) -> Result<(Option<Variable>, Flow), String>
Call closure.
pub fn call(
&mut self,
call: &Call,
module: &Arc<Module>
) -> Result<(Option<Variable>, Flow), String>
[src]
&mut self,
call: &Call,
module: &Arc<Module>
) -> Result<(Option<Variable>, Flow), String>
Called from the outside, e.g. a loader script by call
or call_ret
intrinsic.
pub fn call_str(
&mut self,
function: &str,
args: &[Variable],
module: &Arc<Module>
) -> Result<(), String>
[src]
&mut self,
function: &str,
args: &[Variable],
module: &Arc<Module>
) -> Result<(), String>
Calls function by name.
pub fn call_str_ret(
&mut self,
function: &str,
args: &[Variable],
module: &Arc<Module>
) -> Result<Variable, String>
[src]
&mut self,
function: &str,
args: &[Variable],
module: &Arc<Module>
) -> Result<Variable, String>
Call function by name, returning a value.
Trait Implementations
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Typeable for T where
T: Any,
T: Any,