pub struct StateMachine<S, Error, Context>{ /* private fields */ }Expand description
Defines a state machine
Implementations§
Source§impl<S, Error, Context> StateMachine<S, Error, Context>
impl<S, Error, Context> StateMachine<S, Error, Context>
Sourcepub fn add_action<A>(&mut self, state: S, action: A) -> Result<(), Error>where
A: Action<S, Error, Context> + 'static,
pub fn add_action<A>(&mut self, state: S, action: A) -> Result<(), Error>where
A: Action<S, Error, Context> + 'static,
Add an action to the state machine
Sourcepub fn remove_action(&mut self, state: S)
pub fn remove_action(&mut self, state: S)
Remove an action from the state machine
Sourcepub fn force_change_state(&mut self, state: S) -> Result<(), Error>
pub fn force_change_state(&mut self, state: S) -> Result<(), Error>
Force-change the current state to something else
Trait Implementations§
Auto Trait Implementations§
impl<S, Error, Context> Freeze for StateMachine<S, Error, Context>where
S: Freeze,
impl<S, Error, Context> !RefUnwindSafe for StateMachine<S, Error, Context>
impl<S, Error, Context> !Send for StateMachine<S, Error, Context>
impl<S, Error, Context> !Sync for StateMachine<S, Error, Context>
impl<S, Error, Context> Unpin for StateMachine<S, Error, Context>
impl<S, Error, Context> !UnwindSafe for StateMachine<S, Error, Context>
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