[−][src]Struct compact_arena::TinyArena
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]
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,
B: Send,
T: Send,
impl<T, B> Sync for TinyArena<T, B> where
B: Sync,
T: Sync,
B: Sync,
T: Sync,
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,