EntityRef

Trait EntityRef 

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

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§

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.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl EntityRef for Constant

Source§

fn new(index: usize) -> Constant

Source§

fn index(self) -> usize

Source§

impl EntityRef for DynamicStackSlot

Source§

impl EntityRef for DynamicType

Source§

impl EntityRef for ExceptionTable

Source§

impl EntityRef for ExceptionTag

Source§

impl EntityRef for FuncRef

Source§

fn new(index: usize) -> FuncRef

Source§

fn index(self) -> usize

Source§

impl EntityRef for GlobalValue

Source§

impl EntityRef for Immediate

Source§

fn new(index: usize) -> Immediate

Source§

fn index(self) -> usize

Source§

impl EntityRef for Inst

Source§

fn new(index: usize) -> Inst

Source§

fn index(self) -> usize

Source§

impl EntityRef for JumpTable

Source§

fn new(index: usize) -> JumpTable

Source§

fn index(self) -> usize

Source§

impl EntityRef for MemoryType

Source§

impl EntityRef for SigRef

Source§

fn new(index: usize) -> SigRef

Source§

fn index(self) -> usize

Source§

impl EntityRef for StackSlot

Source§

fn new(index: usize) -> StackSlot

Source§

fn index(self) -> usize

Source§

impl EntityRef for UserExternalNameRef

Source§

impl EntityRef for ValueLabel

Source§

impl EntityRef for Loop

Source§

fn new(index: usize) -> Loop

Source§

fn index(self) -> usize

Source§

impl EntityRef for MachLabel

Source§

fn new(index: usize) -> MachLabel

Source§

fn index(self) -> usize

Source§

impl EntityRef for VCodeConstant

§

impl EntityRef for DataId

§

fn new(index: usize) -> DataId

§

fn index(self) -> usize

§

impl EntityRef for FuncId

§

fn new(index: usize) -> FuncId

§

fn index(self) -> usize

§

impl EntityRef for FuncIndex

§

fn new(index: usize) -> FuncIndex

§

fn index(self) -> usize

Implementors§