[−][src]Struct typed_generational_arena::Index
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);
Methods
impl<T, I: ArenaIndex + Copy, G: FixedGenerationalIndex + Copy> Index<T, I, G>
[src]
pub fn to_idx(&self) -> usize
[src]
Get this index as a usize
pub fn arr_idx(&self) -> I
[src]
Get this index's array index into the arena
pub fn gen(&self) -> G
[src]
Get this index's generation
impl<T, I: ArenaIndex + Copy, G: FixedGenerationalIndex> Index<T, I, G>
[src]
pub fn from_idx_first_gen(n: usize) -> Self
[src]
Convert a usize
to an index at the first generation
impl<T, I: ArenaIndex + Copy, G: IgnoredGeneration> Index<T, I, G>
[src]
impl<T, I: ArenaIndex, G: FixedGenerationalIndex> Index<T, I, G>
[src]
pub fn new(index: I, generation: G) -> Index<T, I, G>
[src]
Create a new index from a given array index and generation
Trait Implementations
impl<T, I, G> Debug for Index<T, I, G> where
I: Debug,
G: Debug,
[src]
I: Debug,
G: Debug,
impl<T, I, G> PartialEq<Index<T, I, G>> for Index<T, I, G> where
I: PartialEq,
G: PartialEq,
[src]
I: PartialEq,
G: PartialEq,
fn eq(&self, other: &Self) -> bool
[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl<T, I, G> Eq for Index<T, I, G> where
I: Eq,
G: Eq,
[src]
I: Eq,
G: Eq,
impl<T, I: ArenaIndex + Ord, G: FixedGenerationalIndex> Ord for Index<T, I, G>
[src]
fn cmp(&self, other: &Self) -> Ordering
[src]
fn max(self, other: Self) -> Self
1.21.0[src]
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.21.0[src]
Compares and returns the minimum of two values. Read more
fn clamp(self, min: Self, max: Self) -> Self
[src]
clamp
)Restrict a value to a certain interval. Read more
impl<T, I: ArenaIndex + PartialOrd, G: FixedGenerationalIndex> PartialOrd<Index<T, I, G>> for Index<T, I, G>
[src]
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
[src]
#[must_use]
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests less than (for self
and other
) and is used by the <
operator. Read more
#[must_use]
fn le(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
#[must_use]
fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
#[must_use]
fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl<T, I: ArenaIndex, G: FixedGenerationalIndex> Index<Index<T, I, G>> for Arena<T, I, G>
[src]
type Output = T
The returned type after indexing.
fn index(&self, index: Index<T, I, G>) -> &Self::Output
[src]
impl<T, I: ArenaIndex, G: FixedGenerationalIndex> IndexMut<Index<T, I, G>> for Arena<T, I, G>
[src]
impl<T, I, G> Hash for Index<T, I, G> where
I: Hash,
G: Hash,
[src]
I: Hash,
G: Hash,
fn hash<__HTIG>(&self, __state: &mut __HTIG) where
__HTIG: Hasher,
[src]
__HTIG: Hasher,
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl<T, I: ArenaIndex + Copy, G: FixedGenerationalIndex + Copy> Copy for Index<T, I, G>
[src]
impl<T, I, G> Clone for Index<T, I, G> where
I: Clone,
G: Clone,
[src]
I: Clone,
G: Clone,
Auto Trait Implementations
impl<T, I, G> Unpin for Index<T, I, G> where
G: Unpin,
I: Unpin,
G: Unpin,
I: Unpin,
impl<T, I, G> Sync for Index<T, I, G> where
G: Sync,
I: Sync,
G: Sync,
I: Sync,
impl<T, I, G> Send for Index<T, I, G> where
G: Send,
I: Send,
G: Send,
I: Send,
impl<T, I, G> UnwindSafe for Index<T, I, G> where
G: UnwindSafe,
I: UnwindSafe,
G: UnwindSafe,
I: UnwindSafe,
impl<T, I, G> RefUnwindSafe for Index<T, I, G> where
G: RefUnwindSafe,
I: RefUnwindSafe,
G: RefUnwindSafe,
I: RefUnwindSafe,
Blanket Implementations
impl<T, U> TryFrom<U> 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, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryInto<U> 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> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,