[][src]Trait components_arena::ComponentIndex

pub unsafe trait ComponentIndex: Debug + Copy + Eq + Hash + Ord + TryInto<usize> + TryFrom<usize> { }

An implementor of the ComponentIndex trait can be used as an index part type of Id.

In the generational arena approach every component has an id consisting of two parts: index, and actual unique id. First part, index, is distinct for all alive components, but second one, unique, is distinct for all components created during application run time.

Safety

Safe implementation should purely, correctly and consistently implement Clone, PartialEq, Eq, Hash, PartialOrd, and Ord traits.

The TryInto<usize> and TryFrom<usize> implementaions should be pure, and if try_from(n) is Ok(x) then try_into(x) should be Ok(n).

Implementations on Foreign Types

impl ComponentIndex for u8[src]

impl ComponentIndex for u16[src]

impl ComponentIndex for u32[src]

impl ComponentIndex for u64[src]

impl ComponentIndex for u128[src]

impl ComponentIndex for usize[src]

Loading content...

Implementors

Loading content...