Skip to main content

Machine

Trait Machine 

Source
pub trait Machine:
    Sized
    + 'static
    + Send
    + Sync {
    type Input: Input;
    type Param: Param;
    type State: State;

    // Required methods
    fn init(&self, input: &Self::Input, param: &Self::Param) -> Self::State;
    fn next(
        &self,
        state: &Self::State,
        input: &Self::Input,
        param: &Self::Param,
    ) -> Self::State;
}
Expand description

Finite-state machine intended to be verifiable by machine-check.

To actually be verifiable by machine-check, further processing must be done by enclosing the structures and the Machine implementation within the machine_description macro.

Required Associated Types§

Source

type Input: Input

Machine input.

Source

type Param: Param

Machine parameter.

Source

type State: State

Machine state.

Required Methods§

Source

fn init(&self, input: &Self::Input, param: &Self::Param) -> Self::State

Creates an initial state from an initial input.

Source

fn next( &self, state: &Self::State, input: &Self::Input, param: &Self::Param, ) -> Self::State

Creates next state from current state, given the input.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§