Struct jlrs::memory::frame::GcFrame[][src]

pub struct GcFrame<'frame, M: Mode> { /* fields omitted */ }

A frame that can be used to root values.

Roots are stored in slots, each slot can contain one root. Frames created with slots will preallocate that number of slots. Frames created without slots will dynamically create new slots as needed. If a frame is created without slots it is able to create at least 16 slots.

If there is sufficient capacity available, a new frame will use this remaining capacity. If the capacity is insufficient, more stack space is allocated.

Implementations

impl<'frame, M: Mode> GcFrame<'frame, M>[src]

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

Returns the number of values currently rooted in this frame.

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

Returns the number of slots that are currently allocated to this frame.

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

Returns the maximum number of slots this frame can use.

#[must_use]
pub fn alloc_slots(&mut self, additional: usize) -> bool
[src]

Try to allocate additional slots in the current frame. Returns true on success, or false if self.n_slots() + additional > self.capacity().

Trait Implementations

impl<'frame, M: Mode> Drop for GcFrame<'frame, M>[src]

impl<'frame, M: Mode> Frame<'frame> for GcFrame<'frame, M>[src]

Auto Trait Implementations

impl<'frame, M> RefUnwindSafe for GcFrame<'frame, M> where
    M: RefUnwindSafe

impl<'frame, M> !Send for GcFrame<'frame, M>

impl<'frame, M> !Sync for GcFrame<'frame, M>

impl<'frame, M> Unpin for GcFrame<'frame, M> where
    M: Unpin

impl<'frame, M> !UnwindSafe for GcFrame<'frame, M>

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<'frame, T> Gc for T where
    T: Frame<'frame>, 
[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.