use thiserror::Error;
#[derive(Debug, Clone, Copy, Eq, PartialEq, Error)]
pub enum FastStateMachineBuildError {
#[error("state count is not configured")]
StateCountNotConfigured,
#[error("event count is not configured")]
EventCountNotConfigured,
#[error("state count must be positive: {count}")]
InvalidStateCount {
count: usize,
},
#[error("event count must be positive: {count}")]
InvalidEventCount {
count: usize,
},
#[error("transition table overflowed usize: {state_count} * {event_count}")]
TransitionTableOverflow {
state_count: usize,
event_count: usize,
},
#[error("initial state is out of range: {state} >= {state_count}")]
InitialStateOutOfRange {
state: usize,
state_count: usize,
},
#[error("final state is out of range: {state} >= {state_count}")]
FinalStateOutOfRange {
state: usize,
state_count: usize,
},
#[error("transition source is out of range: {source_state} >= {state_count}")]
TransitionSourceOutOfRange {
source_state: usize,
state_count: usize,
},
#[error("transition event is out of range: {event} >= {event_count}")]
TransitionEventOutOfRange {
event: usize,
event_count: usize,
},
#[error("transition target is out of range: {target} >= {state_count}")]
TransitionTargetOutOfRange {
target: usize,
state_count: usize,
},
#[error(
"duplicate transition: {source_state} --{event}--> {existing_target} conflicts with {new_target}"
)]
DuplicateTransition {
source_state: usize,
event: usize,
existing_target: usize,
new_target: usize,
},
}