pub struct ArenaIndex(/* private fields */);Expand description
Index into the arena.
This is a lightweight wrapper around usize that directly indexes
the arena’s internal array.
§Safety Note
Indices should only be obtained from arena operations (alloc, iter).
Manually constructing indices bypasses the type system’s protection
and should only be used for serialization/deserialization.
Implementations§
Source§impl ArenaIndex
impl ArenaIndex
Sourcepub const NULL: ArenaIndex
pub const NULL: ArenaIndex
A sentinel “null” index that is never valid.
This can be used as a placeholder when an optional index is needed
but Option<ArenaIndex> is not desired.
Sourcepub const fn new(index: usize) -> ArenaIndex
pub const fn new(index: usize) -> ArenaIndex
Create a new arena index with the given slot index.
§Warning
This is a low-level constructor intended for serialization/deserialization.
For normal use, obtain indices from [Arena::alloc] or [Arena::iter].
Fabricating indices manually may lead to undefined behavior if the
index doesn’t correspond to a valid allocation.
Trait Implementations§
Source§impl Clone for ArenaIndex
impl Clone for ArenaIndex
Source§fn clone(&self) -> ArenaIndex
fn clone(&self) -> ArenaIndex
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ArenaIndex
impl Debug for ArenaIndex
Source§impl Default for ArenaIndex
impl Default for ArenaIndex
Source§fn default() -> ArenaIndex
fn default() -> ArenaIndex
Returns ArenaIndex::NULL.
Source§impl<const N: usize> FromLisp<N> for ArenaIndex
ArenaIndex can be passed through directly (for when you want raw Lisp values)
impl<const N: usize> FromLisp<N> for ArenaIndex
ArenaIndex can be passed through directly (for when you want raw Lisp values)