Trait extfsm::RunsFSM [−][src]
pub trait RunsFSM<EventType, StateType, TransitionFnArguments, ErrorType> { fn add_events(
&mut self,
events: &mut Vec<(EventType, OptionalFnArg<TransitionFnArguments>)>
) -> Result<u32, Errors<EventType, StateType, ErrorType>>; fn extend_events<I>(&mut self, iter: I)
where
I: IntoIterator<Item = (EventType, Option<TransitionFnArguments>)>; fn process_event_queue(
&mut self
) -> Result<u32, Errors<EventType, StateType, ErrorType>>; }
trait that can process events from a queue using a transition table
Required Methods
fn add_events(
&mut self,
events: &mut Vec<(EventType, OptionalFnArg<TransitionFnArguments>)>
) -> Result<u32, Errors<EventType, StateType, ErrorType>>
&mut self,
events: &mut Vec<(EventType, OptionalFnArg<TransitionFnArguments>)>
) -> Result<u32, Errors<EventType, StateType, ErrorType>>
add events to the event queue @ the back, events are not processed
fn extend_events<I>(&mut self, iter: I) where
I: IntoIterator<Item = (EventType, Option<TransitionFnArguments>)>,
I: IntoIterator<Item = (EventType, Option<TransitionFnArguments>)>,
add events to the event queue @ the back from an iterator, events are not processed
fn process_event_queue(
&mut self
) -> Result<u32, Errors<EventType, StateType, ErrorType>>
&mut self
) -> Result<u32, Errors<EventType, StateType, ErrorType>>
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
returns
- number of events processed or errors encountered.
On errors not much can be done
except killing the FSM instance
Implementors
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 + Debug,
ErrorType: Debug,