pub enum DynamicError<E = ()> {
InvalidTransition {
from: &'static str,
event: &'static str,
},
GuardFailed {
guard: &'static str,
event: &'static str,
},
ActionFailed {
action: &'static str,
event: &'static str,
},
CallbackFailed {
action: &'static str,
event: &'static str,
source: E,
},
WrongState {
expected: &'static str,
actual: &'static str,
operation: &'static str,
},
}Expand description
Error returned when dynamic dispatch fails.
This error type is used by the dynamic mode wrapper when runtime event dispatch encounters errors like invalid transitions or guard failures.
Variants§
InvalidTransition
Attempted to trigger an event that’s not valid from the current state.
GuardFailed
A guard callback failed during the transition.
ActionFailed
An action callback failed during the transition.
CallbackFailed
A before/after callback returned a user-defined error.
WrongState
Attempted to access or modify state data when in wrong state.
Implementations§
Source§impl<E> DynamicError<E>
impl<E> DynamicError<E>
pub fn invalid_transition(from: &'static str, event: &'static str) -> Self
pub fn guard_failed(guard: &'static str, event: &'static str) -> Self
pub fn action_failed(action: &'static str, event: &'static str) -> Self
pub fn callback_failed( action: &'static str, event: &'static str, source: E, ) -> Self
pub fn wrong_state( expected: &'static str, actual: &'static str, operation: &'static str, ) -> Self
Sourcepub fn from_guard_error(err: GuardError) -> Self
pub fn from_guard_error(err: GuardError) -> Self
Convert from GuardError to DynamicError.
pub fn from_event_error(err: EventError<E>) -> Self
Trait Implementations§
Source§impl<E: Clone> Clone for DynamicError<E>
impl<E: Clone> Clone for DynamicError<E>
Source§fn clone(&self) -> DynamicError<E>
fn clone(&self) -> DynamicError<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<E: Debug> Debug for DynamicError<E>
impl<E: Debug> Debug for DynamicError<E>
Source§impl<E: PartialEq> PartialEq for DynamicError<E>
impl<E: PartialEq> PartialEq for DynamicError<E>
impl<E: Eq> Eq for DynamicError<E>
impl<E> StructuralPartialEq for DynamicError<E>
Auto Trait Implementations§
impl<E> Freeze for DynamicError<E>where
E: Freeze,
impl<E> RefUnwindSafe for DynamicError<E>where
E: RefUnwindSafe,
impl<E> Send for DynamicError<E>where
E: Send,
impl<E> Sync for DynamicError<E>where
E: Sync,
impl<E> Unpin for DynamicError<E>where
E: Unpin,
impl<E> UnsafeUnpin for DynamicError<E>where
E: UnsafeUnpin,
impl<E> UnwindSafe for DynamicError<E>where
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