[][src]Struct compact_arena::TinyArena

pub struct TinyArena<T, B> { /* fields omitted */ }

A "tiny" arena containing <64K elements. This variant only works with types implementing Default.

You will likely use this via the in_tiny_arena function.

Methods

impl<T: Copy + Clone + Default, B> TinyArena<T, B>[src]

pub unsafe fn new(_: B) -> TinyArena<T, B>[src]

create a new TinyArena. Don't do this manually. Use the in_tiny_arena macro instead.

Safety

The whole tagged indexing trick relies on the B type you give to this constructor. You must never use this type in another arena, lest you might be able to mix up the indices of the two, which could lead to out of bounds access and thus Undefined Behavior!

pub fn add(&mut self, item: T) -> Idx16<B>[src]

Add an item to the arena, get an index back

Trait Implementations

impl<T, B> Index<Idx<u16, B>> for TinyArena<T, B>[src]

type Output = T

The returned type after indexing.

impl<T, B> IndexMut<Idx<u16, B>> for TinyArena<T, B>[src]

Auto Trait Implementations

impl<T, B> Send for TinyArena<T, B> where
    B: Send,
    T: Send

impl<T, B> Sync for TinyArena<T, B> where
    B: Sync,
    T: Sync

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]