pub struct BasicFSM<S, E> { /* private fields */ }Expand description
A concrete FSM implementation with transition history and callbacks.
Implementations§
Source§impl<S: Clone + PartialEq + Debug, E: Clone + Debug> BasicFSM<S, E>
impl<S: Clone + PartialEq + Debug, E: Clone + Debug> BasicFSM<S, E>
Trait Implementations§
Source§impl<S: Clone + PartialEq + Debug, E: Clone + Debug> StateMachine for BasicFSM<S, E>
impl<S: Clone + PartialEq + Debug, E: Clone + Debug> StateMachine for BasicFSM<S, E>
type State = S
type Event = E
Source§fn transition(&mut self, event: &E) -> &S
fn transition(&mut self, event: &E) -> &S
Process an event, potentially transitioning to a new state.
Returns the new state (or current if no transition).
Source§fn can_transition(&self, event: &E) -> bool
fn can_transition(&self, event: &E) -> bool
Check if a transition is valid without executing it
Auto Trait Implementations§
impl<S, E> Freeze for BasicFSM<S, E>where
S: Freeze,
impl<S, E> !RefUnwindSafe for BasicFSM<S, E>
impl<S, E> !Send for BasicFSM<S, E>
impl<S, E> !Sync for BasicFSM<S, E>
impl<S, E> Unpin for BasicFSM<S, E>
impl<S, E> UnsafeUnpin for BasicFSM<S, E>where
S: UnsafeUnpin,
impl<S, E> !UnwindSafe for BasicFSM<S, E>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more