pub struct Heap { /* private fields */ }Implementations§
Source§impl Heap
impl Heap
pub fn new() -> Self
pub fn with_capacity(capacity: usize) -> Self
pub fn alloc_object(&mut self) -> HeapHandleId
pub fn alloc_array(&mut self) -> HeapHandleId
pub fn alloc_function( &mut self, bytecode: Bytecode, arg_count: ArgIndex, local_count: LocalIndex, ) -> HeapHandleId
pub fn alloc_string(&mut self, value: String) -> HeapHandleId
pub fn get(&self, handle: HeapHandleId) -> Option<&HeapEntry>
pub fn get_mut(&mut self, handle: HeapHandleId) -> Option<&mut HeapEntry>
pub fn get_object_property( &self, handle: HeapHandleId, key: &str, ) -> Option<&Value>
pub fn set_object_property( &mut self, handle: HeapHandleId, key: String, value: Value, )
pub fn set_array_element( &mut self, handle: HeapHandleId, idx: ArraySize, value: Value, )
Trait Implementations§
Source§impl HeapManager for Heap
impl HeapManager for Heap
fn get(&self, handle: HeapHandleId) -> Option<&HeapEntry>
fn get_mut(&mut self, handle: HeapHandleId) -> Option<&mut HeapEntry>
fn set_object_property( &mut self, handle: HeapHandleId, key: String, value: Value, )
fn get_object_property(&self, handle: HeapHandleId, key: &str) -> Option<&Value>
fn push_array_element(&mut self, handle: HeapHandleId, value: Value)
fn get_array_element( &self, handle: HeapHandleId, idx: ArraySize, ) -> Option<&Value>
fn set_array_element( &mut self, handle: HeapHandleId, idx: ArraySize, value: Value, )
fn remove_object_property(&mut self, handle: HeapHandleId, key: &str)
fn has_object_property(&self, handle: HeapHandleId, key: &str) -> bool
fn size(&self) -> usize
fn is_empty(&self) -> bool
fn clear(&mut self)
fn get_stats(&self) -> HeapStats
fn get_metrics(&self) -> &HeapMetrics
fn collect_garbage(&mut self, roots: &[HeapHandleId]) -> usize
Source§impl HeapOperations for Heap
impl HeapOperations for Heap
fn alloc_object(&mut self) -> HeapHandleId
fn alloc_array(&mut self) -> HeapHandleId
fn alloc_function( &mut self, bytecode: Bytecode, arg_count: ArgIndex, local_count: LocalIndex, ) -> HeapHandleId
fn alloc_string(&mut self, value: String) -> HeapHandleId
Auto Trait Implementations§
impl Freeze for Heap
impl !RefUnwindSafe for Heap
impl !Send for Heap
impl !Sync for Heap
impl Unpin for Heap
impl !UnwindSafe for Heap
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