Struct hrm_interpreter::state::InternalState
source · pub struct InternalState {
pub register: Option<Value>,
pub input_tape: Vec<Value>,
pub output_tape: Vec<Value>,
pub memory: Vec<Option<Value>>,
pub instruction_counter: usize,
/* private fields */
}
Fields
register: Option<Value>
input_tape: Vec<Value>
output_tape: Vec<Value>
memory: Vec<Option<Value>>
instruction_counter: usize
Implementations
sourceimpl InternalState
impl InternalState
pub fn new(register: Option<Value>, counter: usize) -> InternalState
pub fn with_input_tape(self, new_input_tape: Vec<Value>) -> Self
pub fn with_memory(self, new_memory: Vec<Option<Value>>) -> Self
pub fn executed_instructions(&self) -> u32
pub fn increase_executed_instructions(&mut self)
pub fn apply(&mut self, op: Operation) -> Result<(), String>
Trait Implementations
sourceimpl Clone for InternalState
impl Clone for InternalState
sourcefn clone(&self) -> InternalState
fn clone(&self) -> InternalState
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 moresourceimpl Debug for InternalState
impl Debug for InternalState
sourceimpl Serialize for InternalState
impl Serialize for InternalState
Auto Trait Implementations
impl RefUnwindSafe for InternalState
impl Send for InternalState
impl Sync for InternalState
impl Unpin for InternalState
impl UnwindSafe for InternalState
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
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