[][src]Trait cranelift_entity::EntityRef

pub trait EntityRef: Copy + Eq {
    pub fn new(_: usize) -> Self;
pub fn index(self) -> usize; }

A type wrapping a small integer index should implement EntityRef so it can be used as the key of an SecondaryMap or SparseMap.

Required methods

pub fn new(_: usize) -> Self[src]

Create a new entity reference from a small integer. This should crash if the requested index is not representable.

pub fn index(self) -> usize[src]

Get the index that was used to create this entity reference.

Loading content...

Implementors

Loading content...