Struct turingmachine_rs::TuringTape [−][src]
A possibly theorically infinite TuringTape
Implementations
impl<Alphabet: Clone> TuringTape<Alphabet>
[src]
pub fn new(
empty: Alphabet,
start: Alphabet,
initial: Vec<Alphabet>
) -> TuringTape<Alphabet>
[src]
empty: Alphabet,
start: Alphabet,
initial: Vec<Alphabet>
) -> TuringTape<Alphabet>
Initialize a new TuringTape with:
- empty: The token put at empty tape cells
- start: The token put in the first cell
- initial: An vector of tokens to be put after the start token
pub fn get_cursor(&self) -> Alphabet
[src]
Fetch the token at the cursor
pub fn set_cursor(&self, value: Alphabet) -> Alphabet
[src]
Set the token at the cursor and return the old token
pub fn step_right(&self) -> Alphabet
[src]
Make the cursor go one cell to the right
pub fn step_left(&self) -> Alphabet
[src]
Make the cursor go one cell to the left
Will panic if one goes off the tape.
pub fn run_states<S: TuringStates<Alphabet> + PartialEq>(
&self,
start_state: S,
end_states: Vec<S>
) -> S
[src]
&self,
start_state: S,
end_states: Vec<S>
) -> S
Runs from start state until one of the end states has been reached. Will return the end state.
Trait Implementations
impl<Alphabet: Display + Clone> Display for TuringTape<Alphabet>
[src]
Auto Trait Implementations
impl<Alphabet> !RefUnwindSafe for TuringTape<Alphabet>
impl<Alphabet> !Send for TuringTape<Alphabet>
impl<Alphabet> !Sync for TuringTape<Alphabet>
impl<Alphabet> Unpin for TuringTape<Alphabet> where
Alphabet: Unpin,
Alphabet: Unpin,
impl<Alphabet> !UnwindSafe for TuringTape<Alphabet>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,