Trait sfsm::State[][src]

pub trait State {
    pub fn entry(&mut self) { ... }
pub fn execute(&mut self) { ... }
pub fn exit(&mut self) { ... } }

Trait that must be implemented by all states

Allows to define behavior when entering, exiting and running the state. Both the entry and exit function will only be executed once for each state. The execute function will be executed as long as the state does not transition into another state. There can only ever be one single state active.

Provided methods

pub fn entry(&mut self)[src]

Implement any behavior that hast to be executed when entering the state.

pub fn execute(&mut self)[src]

Implement any behavior that has to be executed when the state is being executed. This function will be called as long as the state does not transit.

pub fn exit(&mut self)[src]

Implement any behavior that hast to be executed when exiting the state.

Loading content...

Implementors

Loading content...