Trait AutomatonState

Source
pub trait AutomatonState<'a, Id, D, E> {
    // Required methods
    fn get_id_owned(&self) -> Id;
    fn get_id(&self) -> &Id;
    fn execute_next_connection(
        &self,
        data: &mut D,
    ) -> Result<NextState<'a, Id, D, E>, E>;
}
Expand description

Representation of a node in automaton graph. States act as stop points for an automaton where next states are determined or for halting the execution when no more state changes can be done.

Required Methods§

Source

fn get_id_owned(&self) -> Id

Owned identifier used for identifying current state.

Source

fn get_id(&self) -> &Id

Reference to identifier user for identifying current state.

Source

fn execute_next_connection( &self, data: &mut D, ) -> Result<NextState<'a, Id, D, E>, E>

Represents change of current state in graph. Provides state to be executed by automaton. Implementations should use this method for executing operations connected with state change.

Implementors§

Source§

impl<'a, K, Id, D, E> AutomatonState<'a, Id, D, E> for SimpleStateImplementation<'a, K, Id, D, E>
where D: KeyProvidingData<K>, Id: Copy,