pub struct Instruction(/* private fields */);Expand description
Zero-cost abstraction for Lua 5.5 instruction encoding Internally stores a 32-bit instruction following Lua 5.5 format
Implementations§
Source§impl Instruction
impl Instruction
pub const SIZE_OP: u32 = 7
pub const SIZE_A: u32 = 8
pub const SIZE_B: u32 = 8
pub const SIZE_C: u32 = 8
pub const SIZE_K: u32 = 1
pub const SIZE_V_B: u32 = 6
pub const SIZE_V_C: u32 = 10
pub const SIZE_BX: u32
pub const SIZE_AX: u32
pub const SIZE_SJ: u32
pub const POS_OP: u32 = 0
pub const POS_A: u32
pub const POS_K: u32
pub const POS_B: u32
pub const POS_C: u32
pub const POS_V_B: u32
pub const POS_V_C: u32
pub const POS_BX: u32 = Self::POS_K
pub const POS_AX: u32 = Self::POS_A
pub const POS_SJ: u32 = Self::POS_A
pub const MAX_A: u32
pub const MAX_B: u32
pub const MAX_C: u32
pub const MAX_V_B: u32
pub const MAX_V_C: u32
pub const MAX_BX: u32
pub const MAX_AX: u32
pub const MAX_SJ: u32
pub const OFFSET_SB: i32
pub const OFFSET_SC: i32
pub const OFFSET_SBX: i32
pub const OFFSET_SJ: i32
pub fn get_opcode(self) -> OpCode
pub fn set_opcode(&mut self, op: OpCode)
pub fn get_a(self) -> u32
pub fn set_a(&mut self, v: u32)
pub fn get_b(self) -> u32
pub fn get_sb(self) -> i32
pub fn set_b(&mut self, v: u32)
pub fn get_c(self) -> u32
pub fn get_sc(self) -> i32
pub fn set_c(&mut self, v: u32)
pub fn get_k(self) -> bool
pub fn set_k(&mut self, v: bool)
pub fn get_bx(self) -> u32
pub fn get_sbx(self) -> i32
pub fn set_bx(&mut self, v: u32)
pub fn get_ax(self) -> u32
pub fn set_ax(&mut self, v: u32)
pub fn get_sj(self) -> i32
pub fn set_sj(&mut self, v: i32)
pub fn get_vb(self) -> u32
pub fn get_vc(self) -> u32
pub fn create_abc(op: OpCode, a: u32, b: u32, c: u32) -> Self
pub fn create_abck(op: OpCode, a: u32, b: u32, c: u32, k: bool) -> Self
pub fn create_vabck(op: OpCode, a: u32, b: u32, c: u32, k: bool) -> Self
pub fn create_abx(op: OpCode, a: u32, bx: u32) -> Self
pub fn create_asbx(op: OpCode, a: u32, sbx: i32) -> Self
pub fn create_ax(op: OpCode, ax: u32) -> Self
pub fn create_sj(op: OpCode, sj: i32) -> Self
pub fn is_k(x: u32) -> bool
pub fn rk_index(x: u32) -> u32
pub fn encode_abc(op: OpCode, a: u32, b: u32, c: u32) -> Self
pub fn encode_abck(op: OpCode, a: u32, b: u32, c: u32, k: u32) -> Self
pub fn encode_abx(op: OpCode, a: u32, bx: u32) -> Self
pub fn encode_asbx(op: OpCode, a: u32, sbx: i32) -> Self
Trait Implementations§
Source§impl Clone for Instruction
impl Clone for Instruction
Source§fn clone(&self) -> Instruction
fn clone(&self) -> Instruction
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for Instruction
impl Debug for Instruction
Source§impl PartialEq for Instruction
impl PartialEq for Instruction
Source§fn eq(&self, other: &Instruction) -> bool
fn eq(&self, other: &Instruction) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Copy for Instruction
impl Eq for Instruction
impl StructuralPartialEq for Instruction
Auto Trait Implementations§
impl Freeze for Instruction
impl RefUnwindSafe for Instruction
impl Send for Instruction
impl Sync for Instruction
impl Unpin for Instruction
impl UnsafeUnpin for Instruction
impl UnwindSafe for Instruction
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more