Trait pulley_interpreter::regs::Reg

source ·
pub trait Reg:
    Sized
    + Copy
    + Eq
    + Ord
    + Hash
    + Into<AnyReg>
    + Debug
    + Display {
    const RANGE: Range<u8>;

    // Required methods
    unsafe fn new_unchecked(index: u8) -> Self;
    fn to_u8(self) -> u8;

    // Provided methods
    fn new(index: u8) -> Option<Self> { ... }
    fn index(self) -> usize { ... }
}
Expand description

Trait for common register operations.

Required Associated Constants§

source

const RANGE: Range<u8>

Range of valid register indices.

Required Methods§

source

unsafe fn new_unchecked(index: u8) -> Self

Convert a register index to a register, without bounds checking.

source

fn to_u8(self) -> u8

Convert a register to its index.

Provided Methods§

source

fn new(index: u8) -> Option<Self>

Convert a register index to a register, with bounds checking.

source

fn index(self) -> usize

Convert a register to its index.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl Reg for FReg

source§

const RANGE: Range<u8> = _

source§

impl Reg for VReg

source§

const RANGE: Range<u8> = _

source§

impl Reg for XReg

source§

const RANGE: Range<u8> = _