Struct trove::Arena [−][src]
pub struct Arena<T> { /* fields omitted */ }
An arena that can hold values of type T
.
Methods
impl<T> Arena<T>
[src]
impl<T> Arena<T>
pub fn new() -> Self
[src]
pub fn new() -> Self
Creates a new empty arena.
pub fn get(&self, arena_ref: &ArenaRef) -> &T
[src]
pub fn get(&self, arena_ref: &ArenaRef) -> &T
Get a reference into the arena.
Panics on out-of bound access.
pub unsafe fn get_mut(&self, owned: &ArenaRef) -> &mut T
[src]
pub unsafe fn get_mut(&self, owned: &ArenaRef) -> &mut T
Get a mutable reference into the arena. this is unsafe, since you could easily alias mutable references.
pub fn append(&self, t: T) -> ArenaRef
[src]
pub fn append(&self, t: T) -> ArenaRef
Puts a value into the arena, returning an owned reference
ⓘImportant traits for ArenaIter<'a, T>pub fn iter(&self) -> ArenaIter<T>
[src]
ⓘImportant traits for ArenaIter<'a, T>
pub fn iter(&self) -> ArenaIter<T>
Returns an iterator over all elements in the Arena
Trait Implementations
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,
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<T> Clone for Arena<T> where
T: Clone,
[src]
impl<T> Clone for Arena<T> where
T: Clone,