Arena

Struct Arena 

Source
pub struct Arena<R: Rootable, A = Global>
where A: Allocator,
{ /* private fields */ }
Expand description

A garbage collected arena, inside which garbage collected pointers can be allocated.

Implementations§

Source§

impl<R> Arena<R>
where R: Rootable,

Source

pub fn new<F>(f: F) -> Arena<R>
where F: for<'b> FnOnce(&Mutation<'b>) -> R::Root<'b>,

Source

pub fn new_paced<F>(f: F, pacing: Pacing) -> Arena<R>
where F: for<'b> FnOnce(&Mutation<'b>) -> R::Root<'b>,

Source§

impl<R, A> Arena<R, A>
where A: Allocator, R: Rootable,

Source

pub fn new_in<F>(f: F, alloc: A) -> Arena<R, A>
where F: for<'b> FnOnce(&Mutation<'b>) -> R::Root<'b>, A: Allocator + 'static,

Source

pub fn new_paced_in<F>(f: F, pacing: Pacing, alloc: A) -> Arena<R, A>
where F: for<'b> FnOnce(&Mutation<'b>) -> R::Root<'b>, A: Allocator + 'static,

Source

pub fn view<F, Ret>(&self, f: F) -> Ret
where F: for<'b> FnOnce(&R::Root<'b>, &Mutation<'b>) -> Ret,

Source

pub fn view_mut<F, Ret>(&mut self, f: F) -> Ret
where F: for<'b> FnOnce(&mut R::Root<'b>, &Mutation<'b>) -> Ret,

Source

pub fn run_collection(&mut self)

Source

pub fn complete_collection(&mut self)

Source

pub fn allocations(&self) -> usize

Auto Trait Implementations§

§

impl<R, A> Freeze for Arena<R, A>
where <R as Rootable>::Root<'static>: Freeze,

§

impl<R, A = Global> !RefUnwindSafe for Arena<R, A>

§

impl<R, A = Global> !Send for Arena<R, A>

§

impl<R, A = Global> !Sync for Arena<R, A>

§

impl<R, A> Unpin for Arena<R, A>
where <R as Rootable>::Root<'static>: Unpin,

§

impl<R, A = Global> !UnwindSafe for Arena<R, A>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.