Struct contained_turing::Program 
source · pub struct Program<S: Symbolic> {
    pub alphabet: Vec<S>,
    /* private fields */
}Fields§
§alphabet: Vec<S>Implementations§
source§impl<S: Symbolic> Program<S>
 
impl<S: Symbolic> Program<S>
pub fn new(alphabet: impl IntoIterator<Item = S>, final_state: State) -> Self
sourcepub fn instructions(&self) -> &Vec<Instruction<S>>
 
pub fn instructions(&self) -> &Vec<Instruction<S>>
Returns an owned instance of the current Instruction set
sourcepub fn final_state(&self) -> &State
 
pub fn final_state(&self) -> &State
Returns an owned instance of the final state
sourcepub fn get(&self, head: Head<S>) -> Option<&Instruction<S>>
 
pub fn get(&self, head: Head<S>) -> Option<&Instruction<S>>
Given some Head, find the coresponding Instruction
sourcepub fn insert(&mut self, inst: Instruction<S>) -> Option<Instruction<S>>
 
pub fn insert(&mut self, inst: Instruction<S>) -> Option<Instruction<S>>
Try to insert a new Instruction into the program; if the instruction is invalid, return None Otherwise, return the previous instruction at the same Head if it exists
Trait Implementations§
source§impl<'de, S> Deserialize<'de> for Program<S>where
    S: Deserialize<'de> + Symbolic,
 
impl<'de, S> Deserialize<'de> for Program<S>where S: Deserialize<'de> + Symbolic,
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
    __D: Deserializer<'de>,
 
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl<S: Symbolic> Extend<Instruction<S>> for Program<S>
 
impl<S: Symbolic> Extend<Instruction<S>> for Program<S>
source§fn extend<T: IntoIterator<Item = Instruction<S>>>(&mut self, iter: T)
 
fn extend<T: IntoIterator<Item = Instruction<S>>>(&mut self, iter: T)
Extends a collection with the contents of an iterator. Read more
source§fn extend_one(&mut self, item: A)
 
fn extend_one(&mut self, item: A)
🔬This is a nightly-only experimental API. (
extend_one)Extends a collection with exactly one element.
source§fn extend_reserve(&mut self, additional: usize)
 
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one)Reserves capacity in a collection for the given number of additional elements. Read more
source§impl<S: Symbolic> Include<Instruction<S>> for Program<S>
 
impl<S: Symbolic> Include<Instruction<S>> for Program<S>
fn include(&mut self, inst: Instruction<S>)
source§impl<S: Ord + Symbolic> Ord for Program<S>
 
impl<S: Ord + Symbolic> Ord for Program<S>
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
    Self: Sized,
 
fn max(self, other: Self) -> Selfwhere Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl<S: PartialEq + Symbolic> PartialEq<Program<S>> for Program<S>
 
impl<S: PartialEq + Symbolic> PartialEq<Program<S>> for Program<S>
source§impl<S: PartialOrd + Symbolic> PartialOrd<Program<S>> for Program<S>
 
impl<S: PartialOrd + Symbolic> PartialOrd<Program<S>> for Program<S>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
 
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for 
self and other) and is used by the <=
operator. Read more