Struct arret_runtime::boxed::Heap[][src]

#[repr(C)]
pub struct Heap { /* fields omitted */ }

Heap of garbage collected boxes

Implementations

impl Heap[src]

pub fn empty() -> Heap[src]

Returns an empty heap with a default capacity

pub fn new(type_info: TypeInfo, count: usize) -> Heap[src]

Returns a new heap with the given type information and capacity

pub fn should_collect(&self) -> bool[src]

Hints if this heap should be garbage collected

This is a heuristic based on the number of allocations since the last GC cycle.

pub fn alloc_cells(&mut self, count: usize) -> *mut Any[src]

Allocates space for count contiguous cells

pub fn type_info(&self) -> &TypeInfo[src]

Returns the runtime type information associated with the heap

pub fn type_info_mut(&mut self) -> &mut TypeInfo[src]

Returns a mutable reference to the runtime type information associated with the heap

pub fn len(&self) -> usize[src]

Returns the number of allocated cells

pub fn is_empty(&self) -> bool[src]

Returns true if the heap contains no boxes

pub fn place_box<T: Boxed>(&mut self, boxed: T) -> Gc<T>[src]

Places a new boxed value on the heap

Trait Implementations

impl AsHeap for Heap[src]

impl AsInterner for Heap[src]

impl Default for Heap[src]

Auto Trait Implementations

impl !RefUnwindSafe for Heap

impl !Send for Heap

impl !Sync for Heap

impl Unpin for Heap

impl UnwindSafe for Heap

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.