Struct rant::runtime::VM [−][src]
pub struct VM<'rant> { /* fields omitted */ }
The Rant Virtual Machine.
Implementations
impl<'rant> VM<'rant>
[src]
impl<'rant> VM<'rant>
[src]pub fn push_getter_intents(
&mut self,
path: &Rc<AccessPath>,
override_print: bool,
prefer_function: bool,
fallback: Option<Rc<Sequence>>
)
[src]
&mut self,
path: &Rc<AccessPath>,
override_print: bool,
prefer_function: bool,
fallback: Option<Rc<Sequence>>
)
pub fn call_func(
&mut self,
func: RantFunctionRef,
args: Vec<RantValue>,
flag: PrintFlag,
override_print: bool
) -> RuntimeResult<()>
[src]
&mut self,
func: RantFunctionRef,
args: Vec<RantValue>,
flag: PrintFlag,
override_print: bool
) -> RuntimeResult<()>
Prepares a call to a function with the specified arguments.
pub fn check_block(&mut self) -> RuntimeResult<()>
[src]
Checks for an active block and attempts to iterate it. If a valid element is returned, it is pushed onto the call stack.
pub fn pre_push_block(
&mut self,
block: &Rc<Block>,
flag: PrintFlag
) -> RuntimeResult<()>
[src]
&mut self,
block: &Rc<Block>,
flag: PrintFlag
) -> RuntimeResult<()>
Performs any necessary preparation (such as pushing weight intents) before pushing a block. If the block can be pushed immediately, it will be.
pub fn push_block(
&mut self,
block: &Block,
weights: Option<Weights>,
flag: PrintFlag
) -> RuntimeResult<()>
[src]
&mut self,
block: &Block,
weights: Option<Weights>,
flag: PrintFlag
) -> RuntimeResult<()>
Consumes attributes and pushes a block onto the resolver stack.
pub fn get_var_value(
&self,
varname: &str,
access: AccessPathKind,
prefer_function: bool
) -> RuntimeResult<RantValue>
[src]
&self,
varname: &str,
access: AccessPathKind,
prefer_function: bool
) -> RuntimeResult<RantValue>
Gets the value of an existing variable.
pub fn get_var_depth(
&self,
varname: &str,
access: AccessPathKind
) -> RuntimeResult<usize>
[src]
&self,
varname: &str,
access: AccessPathKind
) -> RuntimeResult<usize>
pub fn def_var_value(
&mut self,
varname: &str,
access: AccessPathKind,
val: RantValue,
is_const: bool
) -> RuntimeResult<()>
[src]
&mut self,
varname: &str,
access: AccessPathKind,
val: RantValue,
is_const: bool
) -> RuntimeResult<()>
Defines a new variable in the current scope.
pub fn push_val(&mut self, val: RantValue) -> RuntimeResult<usize>
[src]
Pushes a value onto the value stack.
pub fn pop_val(&mut self) -> RuntimeResult<RantValue>
[src]
Removes and returns the topmost value from the value stack.
pub fn pop_frame(&mut self) -> RuntimeResult<StackFrame<Intent>>
[src]
Removes and returns the topmost frame from the call stack.
pub fn push_frame(
&mut self,
callee: Rc<Sequence>,
use_output: bool
) -> RuntimeResult<()>
[src]
&mut self,
callee: Rc<Sequence>,
use_output: bool
) -> RuntimeResult<()>
Pushes a frame onto the call stack.
pub fn push_native_call_frame(
&mut self,
callee: Box<dyn FnOnce(&mut VM<'_>) -> RuntimeResult<()>>,
use_output: bool,
flavor: StackFrameFlavor
) -> RuntimeResult<()>
[src]
&mut self,
callee: Box<dyn FnOnce(&mut VM<'_>) -> RuntimeResult<()>>,
use_output: bool,
flavor: StackFrameFlavor
) -> RuntimeResult<()>
Pushes an empty frame onto the call stack with a single RuntimeCall
intent.
pub fn push_frame_flavored(
&mut self,
callee: Rc<Sequence>,
use_output: bool,
flavor: StackFrameFlavor
) -> RuntimeResult<()>
[src]
&mut self,
callee: Rc<Sequence>,
use_output: bool,
flavor: StackFrameFlavor
) -> RuntimeResult<()>
Pushes a flavored frame onto the call stack.
pub fn interrupt_repeater(
&mut self,
break_val: Option<RantValue>,
should_continue: bool
) -> RuntimeResult<()>
[src]
&mut self,
break_val: Option<RantValue>,
should_continue: bool
) -> RuntimeResult<()>
Interrupts execution of a repeater and either continues the next iteration or exits the block.
pub fn func_return(&mut self, ret_val: Option<RantValue>) -> RuntimeResult<()>
[src]
Returns from the currently running function.
pub fn cur_frame_mut(&mut self) -> &mut StackFrame<Intent>
[src]
Gets a mutable reference to the topmost frame on the call stack.
pub fn any_cur_frame_mut(&mut self) -> Option<&mut StackFrame<Intent>>
[src]
Safely attempts to get a mutable reference to the topmost frame on the call stack.
pub fn parent_frame_mut(
&mut self,
depth: usize
) -> Option<&mut StackFrame<Intent>>
[src]
&mut self,
depth: usize
) -> Option<&mut StackFrame<Intent>>
Safely attempts to get a mutable reference to the frame depth
frames below the top of the call stack.
pub fn parent_frame(&self, depth: usize) -> Option<&StackFrame<Intent>>
[src]
Safely attempts to get a reference to the frame depth
frames below the top of the call stack.
pub fn cur_frame(&self) -> &StackFrame<Intent>
[src]
Gets a reference to the topmost frame on the call stack.
pub fn rng(&self) -> &RantRng
[src]
Gets a reference to the topmost RNG on the RNG stack.
pub fn rng_clone(&self) -> Rc<RantRng>
[src]
Gets a copy of the topmost RNG on the RNG stack.
pub fn push_rng(&mut self, rng: Rc<RantRng>)
[src]
Adds a new RNG to the top of the RNG stack.
pub fn pop_rng(&mut self) -> Option<Rc<RantRng>>
[src]
Removes the topmost RNG from the RNG stack and returns it.
pub fn context(&self) -> &Rant
[src]
Gets a reference to the Rant context that created the VM.
pub fn context_mut(&mut self) -> &mut Rant
[src]
Gets a mutable reference to the Rant context that created the VM.
pub fn resolver(&self) -> &Resolver
[src]
Gets a reference to the resolver associated with the VM.
pub fn resolver_mut(&mut self) -> &mut Resolver
[src]
Gets a mutable reference to the resolver associated with the VM.
pub fn program(&self) -> &RantProgram
[src]
Gets a reference to the program being executed by the VM.
pub fn push_unwind_state(&mut self, handler: Option<RantFunctionRef>)
[src]
pub fn unwind(&mut self) -> Option<UnwindState>
[src]
Auto Trait Implementations
impl<'rant> !RefUnwindSafe for VM<'rant>
impl<'rant> !RefUnwindSafe for VM<'rant>
impl<'rant> !UnwindSafe for VM<'rant>
impl<'rant> !UnwindSafe for VM<'rant>