Struct stack_graphs::arena::Arena [−][src]
pub struct Arena<T> { /* fields omitted */ }
Manages the life cycle of instances of type T
. You can allocate new instances of T
from
the arena. All of the instances managed by this arena will be dropped as a single operation
when the arena itself is dropped.
Implementations
impl<T> Arena<T>
[src]
impl<T> Arena<T>
[src]pub fn new() -> Arena<T>
[src]
Creates a new arena.
pub fn add(&mut self, item: T) -> Handle<T>
[src]
Adds a new instance to this arena, returning a stable handle to it.
Note that we do not deduplicate instances of T
in any way. If you add two instances that
have the same content, you will get distinct handles for each one.
pub fn get(&self, handle: Handle<T>) -> &T
[src]
Dereferences a handle to an instance owned by this arena, returning a reference to it.
Auto Trait Implementations
impl<T> RefUnwindSafe for Arena<T> where
T: RefUnwindSafe,
impl<T> RefUnwindSafe for Arena<T> where
T: RefUnwindSafe,
impl<T> UnwindSafe for Arena<T> where
T: UnwindSafe,
impl<T> UnwindSafe for Arena<T> where
T: UnwindSafe,