Struct rant::runtime::VM[][src]

pub struct VM<'rant> { /* fields omitted */ }

The Rant Virtual Machine.

Implementations

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]

pub fn call_func(
    &mut self,
    func: RantFunctionRef,
    args: Vec<RantValue>,
    flag: PrintFlag,
    override_print: bool
) -> RuntimeResult<()>
[src]

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]

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]

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]

Gets the value of an existing variable.

pub fn get_var_depth(
    &self,
    varname: &str,
    access: AccessPathKind
) -> RuntimeResult<usize>
[src]

pub fn def_var_value(
    &mut self,
    varname: &str,
    access: AccessPathKind,
    val: RantValue,
    is_const: bool
) -> RuntimeResult<()>
[src]

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 the topmost value from the value stack and returns it.

pub fn pop_frame(&mut self) -> RuntimeResult<StackFrame>[src]

Removes the topmost frame from the call stack and returns it.

pub fn push_frame(
    &mut self,
    callee: Rc<Sequence>,
    use_output: bool
) -> RuntimeResult<()>
[src]

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]

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]

Pushes a flavored frame onto the call stak.

pub fn interrupt_repeater(
    &mut self,
    break_val: Option<RantValue>,
    should_continue: bool
) -> RuntimeResult<()>
[src]

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[src]

Gets a mutable reference to the topmost frame on the call stack.

pub fn any_cur_frame_mut(&mut self) -> Option<&mut StackFrame>[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>[src]

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>[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[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> !Send for VM<'rant>

impl<'rant> !Sync for VM<'rant>

impl<'rant> Unpin for VM<'rant>

impl<'rant> !UnwindSafe for VM<'rant>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,