Trait rust_fsm::StateMachineImpl[][src]

pub trait StateMachineImpl {
    type Input;
    type State;
    type Output;

    const INITIAL_STATE: Self::State;

    fn transition(
        state: &Self::State,
        input: &Self::Input
    ) -> Option<Self::State>;
fn output(state: &Self::State, input: &Self::Input) -> Option<Self::Output>; }

This trait is designed to describe any possible deterministic finite state machine/transducer. This is just a formal definition that may be inconvenient to be used in practical programming, but it is used throughout this library for more practical things.

Associated Types

type Input[src]

The input alphabet.

type State[src]

The set of possible states.

type Output[src]

The output alphabet.

Loading content...

Associated Constants

const INITIAL_STATE: Self::State[src]

The initial state of the machine.

Loading content...

Required methods

fn transition(state: &Self::State, input: &Self::Input) -> Option<Self::State>[src]

The transition fuction that outputs a new state based on the current state and the provided input. Outputs None when there is no transition for a given combination of the input and the state.

fn output(state: &Self::State, input: &Self::Input) -> Option<Self::Output>[src]

The output function that outputs some value from the output alphabet based on the current state and the given input. Outputs None when there is no output for a given combination of the input and the state.

Loading content...

Implementors

Loading content...