turing_machine_rs/core.rs
1use std::fmt::{Debug, Display};
2
3/// [`With`] trait provides the ability to concatenate several [`crate::TuringMachine`]
4/// into one another Turing machine. This trait must be implemented individual
5/// for machine types if it needs.
6pub trait With<T> {
7 /// Output type may have several variantions accoriding to the needs.
8 type Output;
9
10 /// Accepts machine type of `&T` and returns `Output` instance.
11 /// Output must be superpostion of self and T.
12 fn with(&self, other: &T) -> Self::Output;
13}
14
15/// [`Symbol`] provides the ability to use whatever you want (almost)
16/// as a symbol of the [`crate::TuringMachine`] alhabet.
17///
18/// One of most important traits.
19pub trait Symbol: Clone + Debug + Display + Eq + PartialEq {}
20
21impl<T> Symbol for T where T: Clone + Debug + Display + Eq + PartialEq {}