pub trait Frame<'frame>: FramePriv<'frame> {
    fn output(&mut self) -> JlrsResult<Output<'frame>>;
    fn reusable_slot(&mut self) -> JlrsResult<ReusableSlot<'frame>>;
    fn n_roots(&self) -> usize;
    fn capacity(&self) -> usize;

    fn as_scope(&mut self) -> &mut Self { ... }
    fn scope<T, F>(&mut self, func: F) -> JlrsResult<T>
    where
        for<'inner> F: FnOnce(GcFrame<'inner, Self::Mode>) -> JlrsResult<T>
, { ... } fn scope_with_capacity<T, F>(
        &mut self,
        capacity: usize,
        func: F
    ) -> JlrsResult<T>
    where
        for<'inner> F: FnOnce(GcFrame<'inner, Self::Mode>) -> JlrsResult<T>
, { ... } }
Expand description

Functionality shared by the different frame types.

Required Methods

Reserve a new output in the current frame.

Returns an error if the frame is full.

Reserve a new reusable slot in the current frame.

Returns an error if the frame is full.

Returns the number of values currently rooted in this frame.

Returns the maximum number of values that can be rooted in this frame.

Provided Methods

Convert the frame to a scope.

This method takes a mutable reference to a frame and returns it, it can be used as an alternative to borrowing a frame with when a Scope or PartialScope is needed.

Create a new scope and call func with that scope’s frame.

The frame can store at least 16 roots.

Create a new scope and call func with that scope’s frame.

The frame can store at least capacity roots.

Implementors