#[derive(Debug, thiserror::Error)]
#[non_exhaustive]
pub enum Error {
#[error("DFA has zero states. Fix: provide at least one state in the transition table.")]
EmptyDfa,
#[error("invalid transition table: {reason}. Fix: ensure transitions.len() == state_count * class_count. Validate your TransitionTable inputs carefully.")]
InvalidTable {
reason: String,
},
#[error("failed to allocate executable memory: {reason}. Fix: check OS memory limits and mmap permissions.")]
MemoryAllocation {
reason: String,
},
#[error("DFA has {states} states, exceeding the {max}-state JIT limit. Fix: use the interpreted fallback for large DFAs.")]
TooManyStates {
states: usize,
max: usize,
},
}
pub type Result<T> = std::result::Result<T, Error>;