With

Trait With 

Source
pub trait With<T> {
    type Output;

    // Required method
    fn with(&self, other: &T) -> Self::Output;
}
Expand description

With trait provides the ability to concatenate several crate::TuringMachine into one another Turing machine. This trait must be implemented individual for machine types if it needs.

Required Associated Types§

Source

type Output

Output type may have several variantions accoriding to the needs.

Required Methods§

Source

fn with(&self, other: &T) -> Self::Output

Accepts machine type of &T and returns Output instance. Output must be superpostion of self and T.

Implementations on Foreign Types§

Source§

impl<S: Symbol> With<Classic<S>> for Result<Classic<S>, String>

Source§

fn with(&self, other: &Classic<S>) -> Self::Output

Makes superposition with two or more Classic machines by chain. This method accept only Classic struct and can be used only for Result<Classic, String>.

Returns a new [Ok(Classic)] when self is Result::Ok and machines can be concatenated and [Err(String)] when self is Result::Ok but machines have different alphabets or default symbols.

And Returns a copy of [Err(String)] when self is Result::Err.

Source§

type Output = Result<Classic<S>, String>

Implementors§