pub struct InitStateMachine<UserStateMachine: TopState> { /* private fields */ }
Expand description
Represent a precursor to a state machine, waiting to be initialized.
Built using InitStateMachine::from()
from an instance of a user-defined structure
on which has been implemented the TopState
and State
traits.
Implementations§
Source§impl<UserStateMachine: TopState> InitStateMachine<UserStateMachine>
impl<UserStateMachine: TopState> InitStateMachine<UserStateMachine>
Sourcepub fn from(
user_state_machine: UserStateMachine,
) -> InitStateMachine<UserStateMachine>
pub fn from( user_state_machine: UserStateMachine, ) -> InitStateMachine<UserStateMachine>
Build the precursor state machine from you structure which implements the
TopState
trait and as many variants of the State<tag>
trait as
you have states.
Sourcepub fn init(self) -> StateMachine<UserStateMachine>
pub fn init(self) -> StateMachine<UserStateMachine>
Consume the structure instance, triggerring the call to TopState::init()
and
performing transition to the first state. A fully operational state machine
is returned.
Auto Trait Implementations§
impl<UserStateMachine> Freeze for InitStateMachine<UserStateMachine>where
UserStateMachine: Freeze,
impl<UserStateMachine> RefUnwindSafe for InitStateMachine<UserStateMachine>where
UserStateMachine: RefUnwindSafe,
impl<UserStateMachine> Send for InitStateMachine<UserStateMachine>where
UserStateMachine: Send,
impl<UserStateMachine> Sync for InitStateMachine<UserStateMachine>where
UserStateMachine: Sync,
impl<UserStateMachine> Unpin for InitStateMachine<UserStateMachine>where
UserStateMachine: Unpin,
impl<UserStateMachine> UnwindSafe for InitStateMachine<UserStateMachine>where
UserStateMachine: UnwindSafe,
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