wasmer_types::entity

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

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.

Implementors§