Skip to main content

TmIndex

Trait TmIndex 

Source
pub trait TmIndex: Copy {
    // Required method
    fn tm_index(self) -> usize;
}
Expand description

Discriminant-to-index conversion for the two parallel TagMethod enums.

Both lua_types::tagmethod::TagMethod and crate::tagmethods::TagMethod are #[repr(u8)] with the same ORDER TM layout, so casting through u8 yields the correct GlobalState.tmname index for either type.

Required Methods§

Source

fn tm_index(self) -> usize

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl TmIndex for TagMethod

Source§

impl TmIndex for u8

Source§

impl TmIndex for usize

Implementors§