Struct extfsm::FSM [] [src]

pub struct FSM<ExtendedState, StateType, EventType, TransitionFnArguments, ErrorType> where
    StateType: Clone + Eq + Hash + Sized,
    EventType: Clone + Eq + Hash + Sized
{ pub extended_state: RefCell<Box<ExtendedState>>, // some fields omitted }

Finite state machine type

Template parameters

  • ExtendedState - provides a structure that every transition can access and stores extended state
  • TransitionFnArguments - type that can be boxed as parameters to an event instance
  • ErrorType - Errors that transitions can generate internally

Fields

Methods

impl<ExtendedState, StateType, EventType, TransitionFnArguments, ErrorType> FSM<ExtendedState, StateType, EventType, TransitionFnArguments, ErrorType> where
    StateType: Clone + Eq + Hash + Sized,
    EventType: Clone + Eq + Hash + Sized
[src]

implementation of methods to contstruct the machine

[src]

new FSM with an initial extended state box'ed up so it can be passed around easily

[src]

new transition

returns - TRUE if transition has been inserted, FALSE if a previous has been overwritten!

[src]

new enter/exit transition per state executed after the transition right before the state is entered or called before transition on exit. If the machine remains in the same state neither the enter nor the exit transitions are called.

returns - TRUE if transition has been inserted, FALSE if a previous has been overwritten!

[src]

[src]

gives a read only peek into the extended state from the outside of transitions. Must be given up before running machine of course

[src]

check current state read-only

[src]

returns - TRUE if machine has outstanding events queued to process

impl<ExtendedState, StateType, EventType, TransitionFnArguments, ErrorType> FSM<ExtendedState, StateType, EventType, TransitionFnArguments, ErrorType> where
    StateType: Clone + Eq + Ord + Hash + Sized,
    EventType: Clone + Eq + Ord + Hash + Sized
[src]

machine can be dotted if we have ordering on events & states

[src]

provides output of the FSM in dot format

  • filename - optional filename

Trait Implementations

impl<'a, ExtendedState, StateType, EventType, TransitionFnArguments, ErrorType> GraphWalk<'a, DotNodeKey<StateType>, DotEdgeKey<StateType>> for FSM<ExtendedState, StateType, EventType, TransitionFnArguments, ErrorType> where
    StateType: Clone + PartialEq + Eq + Hash + Sized,
    EventType: Clone + PartialEq + Eq + Hash + Sized
[src]

graphwalk

[src]

Returns all the nodes in this graph.

[src]

Returns all of the edges in this graph.

[src]

The source node for edge.

[src]

The target node for edge.

impl<'a, ExtendedState, StateType, EventType, TransitionFnArguments, ErrorType> Labeller<'a, DotNodeKey<StateType>, DotEdgeKey<StateType>> for FSM<ExtendedState, StateType, EventType, TransitionFnArguments, ErrorType> where
    StateType: Clone + PartialEq + Eq + Hash + Sized,
    EventType: Clone + PartialEq + Eq + Hash + Sized
[src]

graph labelling

[src]

Must return a DOT compatible identifier naming the graph.

[src]

Maps n to a unique identifier with respect to self. The implementer is responsible for ensuring that the returned name is a valid DOT identifier. Read more

[src]

Maps n to one of the [graphviz shape names][1]. If None is returned, no shape attribute is specified. Read more

[src]

Maps n to a style that will be used in the rendered output.

[src]

Maps e to arrow style that will be used on the end of an edge. Defaults to default arrow style. Read more

[src]

Maps e to arrow style that will be used on the end of an edge. Defaults to default arrow style. Read more

[src]

Maps e to a style that will be used in the rendered output.

[src]

Maps n to a label that will be used in the rendered output. The label need not be unique, and may be the empty string; the default is just the output from node_id. Read more

[src]

Maps e to a label that will be used in the rendered output. The label need not be unique, and may be the empty string; the default is in fact the empty string. Read more

[src]

Maps e to one of the [graphviz color names][1]. If None is returned, no color attribute is specified. Read more

[src]

Maps n to one of the [graphviz color names][1]. If None is returned, no color attribute is specified. Read more

[src]

The kind of graph, defaults to Kind::Digraph.

impl<ExtendedState, EventType, StateType, TransitionFnArguments, ErrorType> RunsFSM<EventType, StateType, TransitionFnArguments, ErrorType> for FSM<ExtendedState, StateType, EventType, TransitionFnArguments, ErrorType> where
    StateType: Clone + PartialEq + Eq + Hash + Debug + Sized,
    EventType: Clone + PartialEq + Eq + Hash + Debug + Sized,
    ErrorType: Debug
[src]

[src]

add events to the event queue @ the back, events are not processed

[src]

add events to the event queue @ the back from an iterator, events are not processed

[src]

process the whole event queue. Observe that this can generate multiple messages and queue events against the FSM itself again so don't rely which state the machine ends up in Read more