Stateful

Trait Stateful 

Source
pub trait Stateful {
    // Required methods
    fn handle(&self, data_access: StateDataAccess, event: Event) -> StateMachine;
    fn handle_op(
        &self,
        data_access: StateDataAccess,
        op: Operation,
    ) -> StateMachine;
}
Expand description

The FSM trait.

Required Methods§

Source

fn handle(&self, data_access: StateDataAccess, event: Event) -> StateMachine

Handle user’s keyboard/mouse event, this method can access the editor’s data and update UI tree.

Returns next state.

Source

fn handle_op(&self, data_access: StateDataAccess, op: Operation) -> StateMachine

Handle user’s operation, this method can access the editor’s data and update UI tree.

Returns next state.

Implementors§