Enum cpr_bf::Instruction
source · pub enum Instruction {
IncrDP,
DecrDP,
Incr,
Decr,
Output,
Input,
JumpFwd,
JumpBack,
}
Expand description
Represents a single Brainfuck instruction
Variants§
IncrDP
Increment the current data pointer by one
DecrDP
Decrement the current data pointer by one
Incr
Increment the value in the cell that the data pointer currently points to by one
Decr
Decrements the value in the cell that the data pointer currently points to by one
Output
Writes the value in the cell that the data pointer currently points to, to the VM writer
Input
Reads one byte from the VM reader and stores it in the cell that the data pointer currently points to
JumpFwd
If the value in the currently pointed-to cell is zero, jumps forwards to the next matching Instruction::JumpBack
instruction.
JumpBack
If the value in the currently pointer-to cell is not zero, jumps backwards to the previous matching Instruction::JumpFwd
instruction.
Trait Implementations§
source§impl Clone for Instruction
impl Clone for Instruction
source§fn clone(&self) -> Instruction
fn clone(&self) -> Instruction
Returns a copy of the value. Read more
1.0.0 · 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 TryFrom<char> for Instruction
impl TryFrom<char> for Instruction
impl Copy 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 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