#[repr(transparent)]pub struct InstructionPointer(pub u16);
Expand description
An index into the bytecode array
A 16 bit unsigned integer taking up both source operand bytes. It is used by the jump family of instructions under misc.
Instruction pointers are always an absolute offset from the beginning of a
function’s bytecode. Setting a jump’s instruction pointer target to be outside the
bounds of the function’s bytecode will cause a RuntimeError
in the
VirtualMachine
. Runtime errors are safe and recoverable by host code, but hault
client code running in a virtual machine when they are encountered.
Tuple Fields
0: u16
Implementations
sourceimpl InstructionPointer
impl InstructionPointer
pub fn empty_place_holder() -> Self
pub fn as_both_operands(self) -> Instruction
pub fn from_both_operands(instruction: Instruction) -> Self
Trait Implementations
sourceimpl Clone for InstructionPointer
impl Clone for InstructionPointer
sourcefn clone(&self) -> InstructionPointer
fn clone(&self) -> InstructionPointer
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for InstructionPointer
impl Debug for InstructionPointer
sourceimpl Display for InstructionPointer
impl Display for InstructionPointer
impl Copy for InstructionPointer
Auto Trait Implementations
impl RefUnwindSafe for InstructionPointer
impl Send for InstructionPointer
impl Sync for InstructionPointer
impl Unpin for InstructionPointer
impl UnwindSafe for InstructionPointer
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more