pub trait BehaviourFsm<ID: Clone, T: ReactiveInstance<ID> + BehaviourTypesContainer>:
ReactiveInstanceContainer<ID, T>
+ Send
+ Sync {
// Required methods
fn ty(&self) -> &BehaviourTypeId;
fn get_state(&self) -> BehaviourState;
fn set_state(&self, state: BehaviourState);
fn get_validator(&self) -> &dyn BehaviourValidator<ID, T>;
fn get_transitions(&self) -> &dyn BehaviourTransitions<ID, T>;
// Provided method
fn transition(
&self,
target_state: BehaviourState,
) -> Result<(), BehaviourTransitionError> { ... }
}
Required Methods§
Sourcefn ty(&self) -> &BehaviourTypeId
fn ty(&self) -> &BehaviourTypeId
Returns the current state of the behaviour.
Sourcefn get_state(&self) -> BehaviourState
fn get_state(&self) -> BehaviourState
Returns the current state of the behaviour.
Sourcefn set_state(&self, state: BehaviourState)
fn set_state(&self, state: BehaviourState)
Returns the current state of the behaviour.
Sourcefn get_validator(&self) -> &dyn BehaviourValidator<ID, T>
fn get_validator(&self) -> &dyn BehaviourValidator<ID, T>
Returns the validator.
Sourcefn get_transitions(&self) -> &dyn BehaviourTransitions<ID, T>
fn get_transitions(&self) -> &dyn BehaviourTransitions<ID, T>
Returns the validator.
Provided Methods§
Sourcefn transition(
&self,
target_state: BehaviourState,
) -> Result<(), BehaviourTransitionError>
fn transition( &self, target_state: BehaviourState, ) -> Result<(), BehaviourTransitionError>
Executes a behaviour transition.