pub struct Index<T, I = usize, G = u64> { /* private fields */ }
Expand description
An index (and generation) into an Arena
.
To get an Index
, insert an element into an Arena
, and the Index
for
that element will be returned.
§Examples
use typed_generational_arena::StandardArena;
let mut arena = StandardArena::new();
let idx = arena.insert(123);
assert_eq!(arena[idx], 123);
Implementations§
Source§impl<T, I: ArenaIndex + Copy, G: FixedGenerationalIndex + Copy> Index<T, I, G>
impl<T, I: ArenaIndex + Copy, G: FixedGenerationalIndex + Copy> Index<T, I, G>
Source§impl<T, I: ArenaIndex + Copy, G: FixedGenerationalIndex> Index<T, I, G>
impl<T, I: ArenaIndex + Copy, G: FixedGenerationalIndex> Index<T, I, G>
Sourcepub fn from_idx_first_gen(n: usize) -> Self
pub fn from_idx_first_gen(n: usize) -> Self
Convert a usize
to an index at the first generation
Source§impl<T, I: ArenaIndex + Copy, G: IgnoredGeneration> Index<T, I, G>
impl<T, I: ArenaIndex + Copy, G: IgnoredGeneration> Index<T, I, G>
Source§impl<T, I: ArenaIndex, G: FixedGenerationalIndex> Index<T, I, G>
impl<T, I: ArenaIndex, G: FixedGenerationalIndex> Index<T, I, G>
Trait Implementations§
Source§impl<T, I: ArenaIndex, G: FixedGenerationalIndex> Index<Index<T, I, G>> for Arena<T, I, G>
impl<T, I: ArenaIndex, G: FixedGenerationalIndex> Index<Index<T, I, G>> for Arena<T, I, G>
Source§impl<T, I: ArenaIndex, G: FixedGenerationalIndex> IndexMut<Index<T, I, G>> for Arena<T, I, G>
impl<T, I: ArenaIndex, G: FixedGenerationalIndex> IndexMut<Index<T, I, G>> for Arena<T, I, G>
Source§impl<T, I: Ord, G: FixedGenerationalIndex> Ord for Index<T, I, G>
impl<T, I: Ord, G: FixedGenerationalIndex> Ord for Index<T, I, G>
Source§impl<T, I: PartialOrd, G: FixedGenerationalIndex> PartialOrd for Index<T, I, G>
impl<T, I: PartialOrd, G: FixedGenerationalIndex> PartialOrd for Index<T, I, G>
impl<T, I: Copy, G: Copy> Copy for Index<T, I, G>
impl<T, I: Eq, G: Eq> Eq for Index<T, I, G>
Auto Trait Implementations§
impl<T, I, G> Freeze for Index<T, I, G>
impl<T, I, G> RefUnwindSafe for Index<T, I, G>where
I: RefUnwindSafe,
G: RefUnwindSafe,
impl<T, I, G> Send for Index<T, I, G>
impl<T, I, G> Sync for Index<T, I, G>
impl<T, I, G> Unpin for Index<T, I, G>
impl<T, I, G> UnwindSafe for Index<T, I, G>where
I: UnwindSafe,
G: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more