pub struct FSM<'a, S, I, F: Action<S, I>> { /* private fields */ }Expand description
FSM represents a finite state machine.
The FSM is initialized with an initial state and a list of events.
Implementations§
Source§impl<'a, S, I, F> FSM<'a, S, I, F>
impl<'a, S, I, F> FSM<'a, S, I, F>
Sourcepub fn new<T>(
initial: S,
events: impl IntoIterator<Item = EventDesc<T, S>>,
hooks: impl IntoIterator<Item = (HookType<T, S>, F)>,
) -> Self
pub fn new<T>( initial: S, events: impl IntoIterator<Item = EventDesc<T, S>>, hooks: impl IntoIterator<Item = (HookType<T, S>, F)>, ) -> Self
new creates a new FSM.
Sourcepub fn get_current(&self) -> S
pub fn get_current(&self) -> S
get_current returns the current state of the FSM.
Trait Implementations§
Auto Trait Implementations§
impl<'a, S, I, F> Freeze for FSM<'a, S, I, F>where
S: Freeze,
impl<'a, S, I, F> RefUnwindSafe for FSM<'a, S, I, F>
impl<'a, S, I, F> Send for FSM<'a, S, I, F>
impl<'a, S, I, F> Sync for FSM<'a, S, I, F>
impl<'a, S, I, F> Unpin for FSM<'a, S, I, F>
impl<'a, S, I, F> UnwindSafe for FSM<'a, S, I, F>
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)