Trait cretonne_entity::EntityRef
[−]
[src]
pub trait EntityRef: Copy + Eq { fn new(_: usize) -> Self; fn index(self) -> usize; }
A type wrapping a small integer index should implement EntityRef
so it can be used as the key
of an EntityMap
or SparseMap
.
Required Methods
fn new(_: usize) -> Self
Create a new entity reference from a small integer. This should crash if the requested index is not representable.
fn index(self) -> usize
Get the index that was used to create this entity reference.