Skip to main content

VirtualMachine

Struct VirtualMachine 

Source
pub struct VirtualMachine { /* private fields */ }

Implementations§

Source§

impl VirtualMachine

Source

pub fn run(&mut self, chunk: &Chunk) -> Result<Value, String>

Source

pub fn run_module(&mut self, module: &Module) -> Result<Value, String>

Source

pub fn call_export( &mut self, module: &Module, name: &str, args: &[Value], ) -> Result<Value, String>

Source

pub fn reset(&mut self)

Source

pub fn run_to_yield(&mut self, module: &Module) -> Result<(), String>

Source

pub fn resume(&mut self, module: &Module, input: Value) -> Result<bool, String>

Source§

impl VirtualMachine

Source

pub fn new() -> Self

Source

pub fn with_static_names(self, names: Vec<String>) -> Self

Source

pub fn with_step_cap(self, cap: u64) -> Self

Source

pub fn with_heap_check(self, on: bool) -> Self

Source

pub fn steps(&self) -> u64

Source

pub fn halted(&self) -> bool

Source

pub fn exit_code(&self) -> Option<i64>

Source

pub fn with_heap_trace( self, slot: Option<u32>, all: bool, out: fn(&str), ) -> Self

Source

pub fn with_trace_out(self, out: fn(&str)) -> Self

Source

pub fn with_profile(self, on: bool) -> Self

Source

pub fn with_trace_static(self, filter: Option<String>) -> Self

Source

pub fn with_trace_frames(self, on: bool) -> Self

Source

pub fn with_trace_filter(self, bits: Vec<bool>) -> Self

Source

pub fn with_debug_sink(self, sink: DebugSink) -> Self

Source

pub fn with_fn_names(self, names: Vec<String>) -> Self

Source

pub fn profile_report(&self) -> String

Source

pub fn region_push(&mut self)

Source

pub fn region_pop(&mut self) -> Result<(), String>

Source

pub fn region_depth(&self) -> usize

Source

pub fn region_record_alloc(&mut self, slot: u32, generation: u32)

Source

pub fn module_table_rc(&self) -> Option<u32>

Source

pub fn heap_live_count(&self) -> usize

Source

pub fn live_slots_report(&self) -> String

Source

pub fn heap_ref(&self) -> &Heap

Source

pub fn heap_mut(&mut self) -> &mut Heap

Source

pub fn last_result_is_handle(&self) -> bool

Source

pub fn install_device(&mut self, id: u8, dev: Box<dyn Device>)

Source

pub fn register_native<S: Into<String>>(&mut self, name: S, func: NativeFn)

Source

pub fn register_aot_fn<S: Into<String>>(&mut self, name: S, func: AotFn)

Source

pub fn take_device(&mut self, id: u8) -> Option<Box<dyn Device>>

Source

pub fn heap_alloc(&mut self, size: usize) -> (u32, u32)

Source

pub fn heap_st( &mut self, slot: u32, gen_: u32, offset: usize, val: u64, is_handle: bool, ) -> Result<(u64, bool), String>

Source

pub fn push_handler(&mut self, h: HandlerFrame)

Source§

impl VirtualMachine

Source

pub fn render_value(&self, raw: u64, is_handle: bool, depth: usize) -> String

Source

pub fn drop_result_for_test(&mut self, raw: u64)

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.