Trait BehaviourFsm

Source
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§

Source

fn ty(&self) -> &BehaviourTypeId

Returns the current state of the behaviour.

Source

fn get_state(&self) -> BehaviourState

Returns the current state of the behaviour.

Source

fn set_state(&self, state: BehaviourState)

Returns the current state of the behaviour.

Source

fn get_validator(&self) -> &dyn BehaviourValidator<ID, T>

Returns the validator.

Source

fn get_transitions(&self) -> &dyn BehaviourTransitions<ID, T>

Returns the validator.

Provided Methods§

Source

fn transition( &self, target_state: BehaviourState, ) -> Result<(), BehaviourTransitionError>

Executes a behaviour transition.

Implementors§