Struct contained_actors::turing::Program
source · pub struct Program<S: Symbolic> { /* private fields */ }Implementations§
source§impl<S: Symbolic> Program<S>
impl<S: Symbolic> Program<S>
pub fn new(alphabet: Vec<S>, final_state: State) -> Self
sourcepub fn alphabet(&self) -> &Vec<S> ⓘ
pub fn alphabet(&self) -> &Vec<S> ⓘ
Returns an owned instance of the current program’s alphabet
pub fn default_symbol(&self) -> &S
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>) -> Resultant<&Instruction<S>>
pub fn get(&self, head: Head<S>) -> Resultant<&Instruction<S>>
Given some Head, find the coresponding Instruction
sourcepub fn insert(
&mut self,
inst: Instruction<S>
) -> Resultant<Option<Instruction<S>>>
pub fn insert( &mut self, inst: Instruction<S> ) -> Resultant<Option<Instruction<S>>>
Insert a new Instruction set into the program
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>
fn extend<T: IntoIterator<Item = Instruction<S>>>( &mut self, iter: T ) -> Result<(), String>
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 moreimpl<S: Eq + Symbolic> Eq for Program<S>
impl<S: Symbolic> StructuralEq for Program<S>
impl<S: Symbolic> StructuralPartialEq for Program<S>
Auto Trait Implementations§
impl<S> RefUnwindSafe for Program<S>where S: RefUnwindSafe,
impl<S> Send for Program<S>where S: Send,
impl<S> Sync for Program<S>where S: Sync,
impl<S> Unpin for Program<S>where S: Unpin,
impl<S> UnwindSafe for Program<S>where S: UnwindSafe,
Blanket Implementations§
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.