Trait cranelift::prelude::EntityRef

source ·
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§

source

fn new(_: usize) -> Self

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

source

fn index(self) -> usize

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

Object Safety§

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 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

Implementors§