Struct generational_arena::Index [−][src]
pub struct Index { /* fields omitted */ }
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 generational_arena::Arena; let mut arena = Arena::new(); let idx = arena.insert(123); assert_eq!(arena[idx], 123);
Implementations
impl Index
[src]
impl Index
[src]pub fn from_raw_parts(a: usize, b: u64) -> Index
[src][−]
Create a new Index
from its raw parts.
The parts must have been returned from an earlier call to
into_raw_parts
.
Providing arbitrary values will lead to malformed indices and ultimately panics.
pub fn into_raw_parts(self) -> (usize, u64)
[src][−]
Convert this Index
into its raw parts.
This niche method is useful for converting an Index
into another
identifier type. Usually, you should prefer a newtype wrapper around
Index
like pub struct MyIdentifier(Index);
. However, for external
types whose definition you can’t customize, but which you can construct
instances of, this method can be useful.
Trait Implementations
impl PartialOrd<Index> for Index
[src]
impl PartialOrd<Index> for Index
[src]fn partial_cmp(&self, other: &Index) -> Option<Ordering>
[src][−]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src][−]
#[must_use]
pub fn lt(&self, other: &Rhs) -> bool#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src][−]
#[must_use]
pub fn le(&self, other: &Rhs) -> bool#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src][−]
#[must_use]
pub fn gt(&self, other: &Rhs) -> bool#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src][−]
#[must_use]
pub fn ge(&self, other: &Rhs) -> bool