pub enum StateMachineError<S, E> {
UnknownState {
state: S,
},
UnknownTransition {
source: S,
event: E,
},
CasConflict {
attempts: u32,
},
}Expand description
Error returned when an event cannot be applied to the current state.
S is the state type and E is the event type.
Variants§
UnknownState
The current state is not registered in the state machine.
Fields
§
state: SThe unregistered current state.
UnknownTransition
There is no transition for the current state and event pair.
CasConflict
CAS retry limits were exhausted before a transition could be installed.
Trait Implementations§
Source§impl<S: Clone, E: Clone> Clone for StateMachineError<S, E>
impl<S: Clone, E: Clone> Clone for StateMachineError<S, E>
Source§fn clone(&self) -> StateMachineError<S, E>
fn clone(&self) -> StateMachineError<S, E>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<S, E> Display for StateMachineError<S, E>
impl<S, E> Display for StateMachineError<S, E>
Source§impl<S, E> Error for StateMachineError<S, E>
impl<S, E> Error for StateMachineError<S, E>
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
impl<S: Copy, E: Copy> Copy for StateMachineError<S, E>
impl<S: Eq, E: Eq> Eq for StateMachineError<S, E>
impl<S, E> StructuralPartialEq for StateMachineError<S, E>
Auto Trait Implementations§
impl<S, E> Freeze for StateMachineError<S, E>
impl<S, E> RefUnwindSafe for StateMachineError<S, E>where
S: RefUnwindSafe,
E: RefUnwindSafe,
impl<S, E> Send for StateMachineError<S, E>
impl<S, E> Sync for StateMachineError<S, E>
impl<S, E> Unpin for StateMachineError<S, E>
impl<S, E> UnsafeUnpin for StateMachineError<S, E>where
S: UnsafeUnpin,
E: UnsafeUnpin,
impl<S, E> UnwindSafe for StateMachineError<S, E>where
S: UnwindSafe,
E: 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