[−][src]Struct runestick::Vm
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]
context: Arc<Context>,
unit: Arc<Unit>,
stack: Stack
) -> Self
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: Args,
[src]
self,
hash: N,
args: A
) -> Result<VmExecution, VmError> where
N: IntoHash,
A: Args,
Call the given function in the given compilation unit.
Trait Implementations
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> 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, U> TryInto<U> 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<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,