Struct trove::Arena [−][src]
pub struct Arena<T> { /* fields omitted */ }
An arena that can hold values of type T
.
Methods
impl<T: Clone> Arena<T>
[src]
impl<T: Clone> Arena<T>
pub fn new() -> Self
[src]
pub fn new() -> Self
Creates a new empty arena.
pub fn merge(a: &Self, b: &Self) -> Self
[src]
pub fn merge(a: &Self, b: &Self) -> Self
Merges two Arenas into one, in which all
nodes reachable from a
and b
are reachable
pub fn get(&self, arena_idx: &ArenaIdx) -> ArenaRef<T>
[src]
pub fn get(&self, arena_idx: &ArenaIdx) -> ArenaRef<T>
Get a reference into the arena.
Panics on out-of bound access.
pub fn get_mut(&self, arena_idx: &mut ArenaIdx) -> ArenaRefMut<T>
[src]
pub fn get_mut(&self, arena_idx: &mut ArenaIdx) -> ArenaRefMut<T>
Get a mutable reference into the arena.
Panics if aliased, through a RefCell
wrapper
pub fn append(&self, t: T) -> ArenaIdx
[src]
pub fn append(&self, t: T) -> ArenaIdx
Puts a value into the arena, returning an index
Trait Implementations
impl<T> Clone for Arena<T>
[src]
impl<T> Clone for Arena<T>
fn clone(&self) -> Self
[src]
fn clone(&self) -> Self
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0
[src]Performs copy-assignment from source
. Read more
impl<T> Default for Arena<T>
[src]
impl<T> Default for Arena<T>
impl<T> Debug for Arena<T> where
T: Debug,
[src]
impl<T> Debug for Arena<T> where
T: Debug,