gaze_recognizers/error.rs
1/// Error type for recognizer construction and rulepack field validation.
2#[derive(Debug, thiserror::Error)]
3#[non_exhaustive]
4pub enum RecognizerError {
5 /// Regex pattern failed to compile.
6 #[error("invalid regex: {0}")]
7 InvalidRegex(#[source] regex::Error),
8 /// Validator kind is unsupported by this recognizer build.
9 #[error("unsupported validator: {kind}")]
10 UnsupportedValidator {
11 /// Unsupported validator kind.
12 kind: String,
13 },
14 /// Normalizer kind is unsupported by this recognizer build.
15 #[error("unsupported normalizer: {kind}")]
16 UnsupportedNormalizer {
17 /// Unsupported normalizer kind.
18 kind: String,
19 },
20}
21
22/// Result alias for recognizer-local operations.
23pub type Result<T> = std::result::Result<T, RecognizerError>;