pub struct Reg(pub u16);Expand description
A register in the running function’s frame.
Registers are numbered from zero. The first registers hold the
function’s parameters, in order; the rest are locals. Every register
has a declared ValType. The 16-bit width allows
65,536 registers per function.
§Examples
use bytecode_lang::Reg;
assert_eq!(Reg(3).to_string(), "r3");
assert_eq!(Reg(3).index(), 3);Tuple Fields§
§0: u16Implementations§
Trait Implementations§
impl Copy for Reg
impl Eq for Reg
Source§impl Ord for Reg
impl Ord for Reg
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialOrd for Reg
impl PartialOrd for Reg
impl StructuralPartialEq for Reg
Auto Trait Implementations§
impl Freeze for Reg
impl RefUnwindSafe for Reg
impl Send for Reg
impl Sync for Reg
impl Unpin for Reg
impl UnsafeUnpin for Reg
impl UnwindSafe for Reg
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