#[repr(transparent)]pub struct Instruction(pub u32);Expand description
A single Lua bytecode instruction (unsigned 32-bit word).
Tuple Fields§
§0: u32Implementations§
Source§impl Instruction
impl Instruction
Sourcepub const fn get_arg(self, pos: u32, size: u32) -> u32
pub const fn get_arg(self, pos: u32, size: u32) -> u32
Extract a bit-field of size bits at position pos.
Sourcepub fn set_arg(&mut self, v: u32, pos: u32, size: u32)
pub fn set_arg(&mut self, v: u32, pos: u32, size: u32)
Set a bit-field of size bits at position pos to v.
Sourcepub fn set_opcode(&mut self, op: OpCode)
pub fn set_opcode(&mut self, op: OpCode)
Replace the opcode field.
pub const fn arg_a(self) -> u32
pub fn set_arg_a(&mut self, v: u32)
pub const fn arg_k(self) -> u32
pub const fn test_k(self) -> bool
pub fn set_arg_k(&mut self, v: u32)
pub const fn arg_b(self) -> u32
pub const fn arg_s_b(self) -> i32
pub fn set_arg_b(&mut self, v: u32)
pub const fn arg_c(self) -> u32
pub const fn arg_s_c(self) -> i32
pub fn set_arg_c(&mut self, v: u32)
pub const fn arg_bx(self) -> u32
pub fn set_arg_bx(&mut self, v: u32)
pub const fn arg_s_bx(self) -> i32
pub fn set_arg_s_bx(&mut self, b: i32)
pub const fn arg_ax(self) -> u32
pub fn set_arg_ax(&mut self, v: u32)
pub const fn arg_s_j(self) -> i32
pub fn set_arg_s_j(&mut self, j: i32)
Sourcepub fn is_out_top(self) -> bool
pub fn is_out_top(self) -> bool
True if this instruction sets L->top for the next instruction.
(testOTMode(GET_OPCODE(i)) && GETARG_C(i) == 0) || GET_OPCODE(i) == OP_TAILCALL
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 Default for Instruction
impl Default for Instruction
Source§fn default() -> Instruction
fn default() -> Instruction
Returns the “default value” for a type. Read more
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