[][src]Struct compact_arena::NanoArena

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

A "nano" arena containing 255 elements. This variant only works with types implementing Default.

You will likely use this via the in_nano_arena function.

Methods

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

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

create a new NanoArena. Don't do this manually. Use the in_nano_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) -> Idx8<B>[src]

Add an item to the arena, get an index back

Trait Implementations

impl<T, B> Index<Idx<u8, B>> for NanoArena<T, B>[src]

type Output = T

The returned type after indexing.

impl<T, B> IndexMut<Idx<u8, B>> for NanoArena<T, B>[src]

Auto Trait Implementations

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

impl<T, B> Sync for NanoArena<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]