Skip to main content

lua_types/
opcode.rs

1//! `Instruction` — a single packed bytecode word. C-Lua uses `u32`.
2
3#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default)]
4#[repr(transparent)]
5pub struct Instruction(pub u32);
6
7impl Instruction {
8    pub const fn new(raw: u32) -> Self {
9        Instruction(raw)
10    }
11    pub const fn raw(self) -> u32 {
12        self.0
13    }
14}