Skip to main content

GcVM

Struct GcVM 

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

Implementations§

Source§

impl GcVM

Source

pub fn new(bytecode: Bytecode) -> Self

Source

pub fn load_bytecode(&mut self, bytecode: Bytecode)

Replace the current main program while preserving the heap and globals.

Used by the REPL so later lines can read bindings created earlier. Old constant-pool owning refs are released; objects still reachable from globals stay alive.

Source

pub fn heap(&self) -> &GcHeap

Source

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

Source

pub fn set_capture_output(&mut self, capture: bool)

Capture puts/print output in-memory instead of writing to stdout.

Source

pub fn take_output(&mut self) -> String

Drain captured output while leaving capture enabled.

Source

pub fn set_global_names(&mut self, names: Vec<(String, usize)>)

Record which global slot each source-level global name refers to, so reports can state the named root set (see GlobalRoot).

Source

pub fn collect_garbage(&mut self) -> GcCollectionReport

Source

pub fn run(&mut self)

Source

pub fn run_with_budget( &mut self, instruction_budget: usize, ) -> Result<(), GcRuntimeError>

Source

pub fn run_with_budget_classified( &mut self, instruction_budget: usize, ) -> Result<(), GcClassifiedRuntimeError>

Execute with a budget and retain the category assigned at the raise site.

Source

pub fn last_popped_stack_elm(&self) -> Option<GcRef>

Source

pub fn export_last_result(&self) -> Option<Object>

Source

pub fn try_export_last_result(&self) -> Result<Object, String>

Source

pub fn last_result_string(&self) -> String

Auto Trait Implementations§

§

impl !RefUnwindSafe for GcVM

§

impl !Send for GcVM

§

impl !Sync for GcVM

§

impl !UnwindSafe for GcVM

§

impl Freeze for GcVM

§

impl Unpin for GcVM

§

impl UnsafeUnpin for GcVM

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.