pub enum DynamicError {
InvalidTransition {
from: &'static str,
event: &'static str,
},
GuardFailed {
guard: &'static str,
event: &'static str,
},
ActionFailed {
action: &'static str,
event: &'static str,
},
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.
WrongState
Attempted to access or modify state data when in wrong state.
Implementations§
Source§impl DynamicError
impl DynamicError
pub fn invalid_transition( from: &'static str, event: &'static str, ) -> DynamicError
pub fn guard_failed(guard: &'static str, event: &'static str) -> DynamicError
pub fn action_failed(action: &'static str, event: &'static str) -> DynamicError
pub fn wrong_state( expected: &'static str, actual: &'static str, operation: &'static str, ) -> DynamicError
Sourcepub fn from_guard_error(err: GuardError) -> DynamicError
pub fn from_guard_error(err: GuardError) -> DynamicError
Convert from GuardError to DynamicError.
Trait Implementations§
Source§impl Clone for DynamicError
impl Clone for DynamicError
Source§fn clone(&self) -> DynamicError
fn clone(&self) -> DynamicError
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 Debug for DynamicError
impl Debug for DynamicError
Source§impl PartialEq for DynamicError
impl PartialEq for DynamicError
impl Eq for DynamicError
impl StructuralPartialEq for DynamicError
Auto Trait Implementations§
impl Freeze for DynamicError
impl RefUnwindSafe for DynamicError
impl Send for DynamicError
impl Sync for DynamicError
impl Unpin for DynamicError
impl UnwindSafe for DynamicError
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