pub struct GcVM { /* private fields */ }Implementations§
Source§impl GcVM
impl GcVM
pub fn new(bytecode: Bytecode) -> Self
Sourcepub fn load_bytecode(&mut self, bytecode: Bytecode)
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.
pub fn heap(&self) -> &GcHeap
pub fn heap_mut(&mut self) -> &mut GcHeap
Sourcepub fn set_global_names(&mut self, names: Vec<(String, usize)>)
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).
pub fn collect_garbage(&mut self) -> GcCollectionReport
pub fn run(&mut self)
pub fn run_with_budget( &mut self, instruction_budget: usize, ) -> Result<(), GcRuntimeError>
pub fn last_popped_stack_elm(&self) -> Option<GcRef>
pub fn export_last_result(&self) -> Option<Object>
pub fn try_export_last_result(&self) -> Result<Object, String>
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more