#[derive(Debug, thiserror::Error)]
#[non_exhaustive]
pub enum Error {
#[error("scan input is too large ({bytes} bytes, max {max_bytes}). fix: shard the input or use a streaming scanner")]
InputTooLarge {
bytes: usize,
max_bytes: usize,
},
#[error("too many matches ({count} exceeds {max}). fix: reduce pattern count, split input, or increase buffer size")]
MatchBufferOverflow {
count: usize,
max: usize,
},
#[error("pattern set is empty. fix: add at least one pattern before scanning")]
EmptyPatternSet,
#[error("pattern {index} is empty. fix: provide a non-empty byte sequence")]
EmptyPattern {
index: usize,
},
#[error("pattern compilation failed: {reason}")]
PatternCompilationFailed {
reason: String,
},
#[error("{0}")]
Backend(Box<dyn std::error::Error + Send + Sync>),
}
pub type Result<T> = std::result::Result<T, Error>;