pub trait Instruction<Q, S>where
Q: RawState,{
// Required methods
fn direction(&self) -> Direction;
fn current_state(&self) -> &State<Q>;
fn next_state(&self) -> &State<Q>;
fn symbol(&self) -> &S;
fn write_symbol(&self) -> &S;
// Provided methods
fn head(&self) -> Head<&Q, &S> { ... }
fn tail(&self) -> Tail<&Q, &S> { ... }
fn as_rule(&self) -> Rule<&Q, &S> { ... }
}Expand description
The Instruction trait defines the expected behaviors of a particular rule within a
Turing machine program.
Required Methods§
Sourcefn current_state(&self) -> &State<Q>
fn current_state(&self) -> &State<Q>
returns a reference to the current state of the Turing machine
Sourcefn next_state(&self) -> &State<Q>
fn next_state(&self) -> &State<Q>
returns a reference to the next state of the Turing machine
Sourcefn write_symbol(&self) -> &S
fn write_symbol(&self) -> &S
returns a reference to the symbol to be written by the head
Provided Methods§
Sourcefn head(&self) -> Head<&Q, &S>
fn head(&self) -> Head<&Q, &S>
returns an instance of Head containing references to the current state and symbol