Trait contained_turing::Scope
source · pub trait Scope<S: Symbolic>: Include<S> + Insert<usize, S> + Stateful<State> {
// Required methods
fn cursor(&self) -> usize;
fn set_index(&mut self, index: usize);
fn set_symbol(&mut self, elem: S);
fn tape(&self) -> Tape<S>;
// Provided methods
fn current(&self) -> S { ... }
fn shift(&mut self, shift: Move, elem: S) { ... }
}Expand description
Scope describes the focus of the [crate::turing::Turing]
Required Methods§
sourcefn set_index(&mut self, index: usize)
fn set_index(&mut self, index: usize)
Scope::set_index sets the current position of the Scope on the Tape
sourcefn set_symbol(&mut self, elem: S)
fn set_symbol(&mut self, elem: S)
Scope::set_symbol sets the current element of the Scope on the Tape
Provided Methods§
sourcefn current(&self) -> S
fn current(&self) -> S
Scope::current returns the current element of the Scope on the Tape
sourcefn shift(&mut self, shift: Move, elem: S)
fn shift(&mut self, shift: Move, elem: S)
Move::Left inserts a new element at the start of the tape if the current position is 0 Move::Right inserts a new element at the end of the tape if the current position equals the total number of cells Move::Stay does nothing