Enum rustfsm_trait::TransitionResult [−][src]
pub enum TransitionResult<Machine, DestinationState> where
Machine: StateMachine,
DestinationState: Into<Machine::State>, { InvalidTransition, Ok { commands: Vec<Machine::Command>, new_state: DestinationState, shared_state: Machine::SharedState, }, OkNoShare { commands: Vec<Machine::Command>, new_state: DestinationState, }, Err(Machine::Error), }
A transition result is emitted every time the StateMachine handles an event.
Variants
This state does not define a transition for this event from this state. All other errors should use the Err variant.
The transition was successful
The transition was successful with no shared state change
Err(Machine::Error)
There was some error performing the transition
Implementations
impl<Sm, Ds> TransitionResult<Sm, Ds> where
Sm: StateMachine,
Ds: Into<Sm::State>,
[src]
Sm: StateMachine,
Ds: Into<Sm::State>,
pub fn ok<CI>(commands: CI, new_state: Ds) -> Self where
CI: IntoIterator<Item = Sm::Command>,
[src]
CI: IntoIterator<Item = Sm::Command>,
Produce a transition with the provided commands to the provided state. No changes to shared state if it exists
pub fn ok_shared<CI, SS>(commands: CI, new_state: Ds, new_shared: SS) -> Self where
CI: IntoIterator<Item = Sm::Command>,
SS: Into<Sm::SharedState>,
[src]
CI: IntoIterator<Item = Sm::Command>,
SS: Into<Sm::SharedState>,
Produce a transition with the provided commands to the provided state with shared state changes
pub fn from<CurrentState>(current_state: CurrentState) -> Self where
CurrentState: Into<Ds>,
[src]
CurrentState: Into<Ds>,
Uses Into
to produce a transition with no commands from the provided current state to
the provided (by type parameter) destination state.
impl<Sm, Ds> TransitionResult<Sm, Ds> where
Sm: StateMachine,
Ds: Into<Sm::State> + Default,
[src]
Sm: StateMachine,
Ds: Into<Sm::State> + Default,
pub fn commands<CI>(commands: CI) -> Self where
CI: IntoIterator<Item = Sm::Command>,
[src]
CI: IntoIterator<Item = Sm::Command>,
Produce a transition with commands relying on Default for the destination state’s value
pub fn default() -> Self
[src]
Produce a transition with no commands relying on Default for the destination state’s value
impl<Sm, Ds> TransitionResult<Sm, Ds> where
Sm: StateMachine,
Ds: Into<Sm::State>,
[src]
Sm: StateMachine,
Ds: Into<Sm::State>,
pub fn into_general(self) -> TransitionResult<Sm, Sm::State>
[src]
Turns more-specific (struct) transition result into more-general (enum) transition result
Auto Trait Implementations
impl<Machine, DestinationState> RefUnwindSafe for TransitionResult<Machine, DestinationState> where
DestinationState: RefUnwindSafe,
<Machine as StateMachine>::Command: RefUnwindSafe,
<Machine as StateMachine>::Error: RefUnwindSafe,
<Machine as StateMachine>::SharedState: RefUnwindSafe,
DestinationState: RefUnwindSafe,
<Machine as StateMachine>::Command: RefUnwindSafe,
<Machine as StateMachine>::Error: RefUnwindSafe,
<Machine as StateMachine>::SharedState: RefUnwindSafe,
impl<Machine, DestinationState> Send for TransitionResult<Machine, DestinationState> where
DestinationState: Send,
<Machine as StateMachine>::Command: Send,
<Machine as StateMachine>::Error: Send,
<Machine as StateMachine>::SharedState: Send,
DestinationState: Send,
<Machine as StateMachine>::Command: Send,
<Machine as StateMachine>::Error: Send,
<Machine as StateMachine>::SharedState: Send,
impl<Machine, DestinationState> Sync for TransitionResult<Machine, DestinationState> where
DestinationState: Sync,
<Machine as StateMachine>::Command: Sync,
<Machine as StateMachine>::Error: Sync,
<Machine as StateMachine>::SharedState: Sync,
DestinationState: Sync,
<Machine as StateMachine>::Command: Sync,
<Machine as StateMachine>::Error: Sync,
<Machine as StateMachine>::SharedState: Sync,
impl<Machine, DestinationState> Unpin for TransitionResult<Machine, DestinationState> where
DestinationState: Unpin,
<Machine as StateMachine>::Command: Unpin,
<Machine as StateMachine>::Error: Unpin,
<Machine as StateMachine>::SharedState: Unpin,
DestinationState: Unpin,
<Machine as StateMachine>::Command: Unpin,
<Machine as StateMachine>::Error: Unpin,
<Machine as StateMachine>::SharedState: Unpin,
impl<Machine, DestinationState> UnwindSafe for TransitionResult<Machine, DestinationState> where
DestinationState: UnwindSafe,
<Machine as StateMachine>::Command: UnwindSafe,
<Machine as StateMachine>::Error: UnwindSafe,
<Machine as StateMachine>::SharedState: UnwindSafe,
DestinationState: UnwindSafe,
<Machine as StateMachine>::Command: UnwindSafe,
<Machine as StateMachine>::Error: UnwindSafe,
<Machine as StateMachine>::SharedState: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,