Enum alure::instr::ControlFlowOp [−][src]
pub enum ControlFlowOp { Fail, Succ, Jmp(u16), Jif(u16), Routine(u16), Call(LibSite), Exec(LibSite), Ret, }
Expand description
Control-flow instructions
Variants
Completes program execution writing false
to st0
(indicating
program failure)
Completes program execution writing true
to st0
(indicating program
success)
Jmp(u16)
Unconditionally jumps to an offset. Increments cy0
.
Jif(u16)
Jumps to an offset if st0
== true, otherwise does nothing. Increments
cy0
.
Routine(u16)
Jumps to other location in the current code with ability to return
back (calls a subroutine). Increments cy0
and pushes offset of the
instruction which follows current one to cs0
.
Call(LibSite)
Calls code from an external library identified by the hash of its code.
Increments cy0
and cp0
and pushes offset of the instruction which
follows current one to cs0
.
Exec(LibSite)
Passes execution to other library without an option to return.
Does not increments cy0
and cp0
counters and does not add anything
to the call stack cs0
.
Returns execution flow to the previous location from the top of cs0
.
Does not change value in cy0
. Decrements cp0
.
Trait Implementations
impl Bytecode for ControlFlowOp
[src]
impl Bytecode for ControlFlowOp
[src]fn byte_count(&self) -> u16
[src]
fn byte_count(&self) -> u16
[src]Returns number of bytes which instruction and its argument occupies
fn instr_range() -> RangeInclusive<u8>
[src]
fn instr_range() -> RangeInclusive<u8>
[src]Returns range of instruction btecodes covered by a set of operations
fn instr_byte(&self) -> u8
[src]
fn instr_byte(&self) -> u8
[src]Returns byte representing instruction code (without its arguments)
fn write_args<W>(&self, writer: &mut W) -> Result<(), EncodeError> where
W: Write,
EncodeError: From<<W as Write>::Error>,
[src]
fn write_args<W>(&self, writer: &mut W) -> Result<(), EncodeError> where
W: Write,
EncodeError: From<<W as Write>::Error>,
[src]Writes instruction arguments as bytecode, omitting instruction code byte
fn read<R>(reader: &mut R) -> Result<Self, DecodeError> where
R: Read,
DecodeError: From<<R as Read>::Error>,
[src]
fn read<R>(reader: &mut R) -> Result<Self, DecodeError> where
R: Read,
DecodeError: From<<R as Read>::Error>,
[src]Reads the instruction from bytecode
fn write<W>(&self, writer: &mut W) -> Result<(), EncodeError> where
W: Write,
EncodeError: From<<W as Write>::Error>,
[src]
fn write<W>(&self, writer: &mut W) -> Result<(), EncodeError> where
W: Write,
EncodeError: From<<W as Write>::Error>,
[src]Writes the instruction as bytecode
impl Clone for ControlFlowOp
[src]
impl Clone for ControlFlowOp
[src]fn clone(&self) -> ControlFlowOp
[src]
fn clone(&self) -> ControlFlowOp
[src]Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]Performs copy-assignment from source
. Read more
impl Debug for ControlFlowOp
[src]
impl Debug for ControlFlowOp
[src]impl Display for ControlFlowOp
[src]
impl Display for ControlFlowOp
[src]impl Hash for ControlFlowOp
[src]
impl Hash for ControlFlowOp
[src]impl InstructionSet for ControlFlowOp
[src]
impl InstructionSet for ControlFlowOp
[src]impl Ord for ControlFlowOp
[src]
impl Ord for ControlFlowOp
[src]impl PartialEq<ControlFlowOp> for ControlFlowOp
[src]
impl PartialEq<ControlFlowOp> for ControlFlowOp
[src]fn eq(&self, other: &ControlFlowOp) -> bool
[src]
fn eq(&self, other: &ControlFlowOp) -> bool
[src]This method tests for self
and other
values to be equal, and is used
by ==
. Read more
fn ne(&self, other: &ControlFlowOp) -> bool
[src]
fn ne(&self, other: &ControlFlowOp) -> bool
[src]This method tests for !=
.
impl PartialOrd<ControlFlowOp> for ControlFlowOp
[src]
impl PartialOrd<ControlFlowOp> for ControlFlowOp
[src]fn partial_cmp(&self, other: &ControlFlowOp) -> Option<Ordering>
[src]
fn partial_cmp(&self, other: &ControlFlowOp) -> Option<Ordering>
[src]This method returns an ordering between self
and other
values if one exists. Read more
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than (for self
and other
) and is used by the <
operator. Read more
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl Copy for ControlFlowOp
[src]
impl Eq for ControlFlowOp
[src]
impl StructuralEq for ControlFlowOp
[src]
impl StructuralPartialEq for ControlFlowOp
[src]
Auto Trait Implementations
impl RefUnwindSafe for ControlFlowOp
impl Send for ControlFlowOp
impl Sync for ControlFlowOp
impl Unpin for ControlFlowOp
impl UnwindSafe for ControlFlowOp
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more