[][src]Struct runestick::Vm

pub struct Vm { /* fields omitted */ }

A stack which references variables indirectly from a slab.

Implementations

impl Vm[src]

pub const fn new(context: Arc<Context>, unit: Arc<Unit>) -> Self[src]

Construct a new runestick virtual machine.

pub const fn new_with_stack(
    context: Arc<Context>,
    unit: Arc<Unit>,
    stack: Stack
) -> Self
[src]

Construct a new runestick virtual machine.

pub fn complete(self) -> Result<Value, VmError>[src]

Run the given vm to completion.

If any async instructions are encountered, this will error.

pub async fn async_complete(self) -> Result<Value, VmError>[src]

Run the given vm to completion with support for async functions.

pub fn is_same(&self, context: &Arc<Context>, unit: &Arc<Unit>) -> bool[src]

Test if the virtual machine is the same context and unit as specified.

pub fn set_ip(&mut self, ip: usize)[src]

Set the current instruction pointer.

pub fn stack(&self) -> &Stack[src]

Get the stack.

pub fn stack_mut(&mut self) -> &mut Stack[src]

Get the stack mutably.

pub fn context(&self) -> &Arc<Context>[src]

Access the context related to the virtual machine.

pub fn unit(&self) -> &Arc<Unit>[src]

Access the underlying unit of the virtual machine.

pub fn clear(&mut self)[src]

Reset this virtual machine, freeing all memory used.

pub fn ip(&self) -> usize[src]

Access the current instruction pointer.

pub fn modify_ip(&mut self, offset: isize) -> Result<(), VmError>[src]

Modify the current instruction pointer.

pub fn iter_stack_debug(&self) -> impl Iterator<Item = &Value> + '_[src]

Iterate over the stack, producing the value associated with each stack item.

pub fn call_function<A, N>(
    self,
    hash: N,
    args: A
) -> Result<VmExecution, VmError> where
    N: IntoHash,
    A: IntoArgs
[src]

Call the given function in the given compilation unit.

Trait Implementations

impl Clone for Vm[src]

impl Debug for Vm[src]

Auto Trait Implementations

impl !RefUnwindSafe for Vm

impl !Send for Vm

impl !Sync for Vm

impl Unpin for Vm

impl !UnwindSafe for Vm

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> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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>,