#[non_exhaustive]pub enum PatternError {
ParseError {
offset: usize,
message: String,
},
UnsupportedEscape {
offset: usize,
escape: char,
},
RecursionLimit {
limit: usize,
},
StateOverflow {
limit: u32,
},
EmptyPatternSet,
}Expand description
Construction error shared across the pipeline.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
ParseError
Regex source contained a character outside the supported subset or a malformed sequence.
Carries the byte offset and a human-readable description. Every
message starts with Fix: so consumers can surface the remediation
directly to end users.
Fields
UnsupportedEscape
Regex source used an escape sequence reserved for regex shorthand or anchor semantics that this byte-oriented frontend does not implement.
Fields
RecursionLimit
Regex source exceeded the parser’s bounded recursive group nesting.
StateOverflow
The NFA or DFA exceeded a configured state budget.
EmptyPatternSet
The pattern set was empty or otherwise structurally invalid for composite assembly (e.g., mixing empty regex with literal patterns).
Trait Implementations§
Source§impl Clone for PatternError
impl Clone for PatternError
Source§fn clone(&self) -> PatternError
fn clone(&self) -> PatternError
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 PatternError
impl Debug for PatternError
Source§impl Display for PatternError
impl Display for PatternError
Source§impl Error for PatternError
impl Error for PatternError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl PartialEq for PatternError
impl PartialEq for PatternError
impl Eq for PatternError
impl StructuralPartialEq for PatternError
Auto Trait Implementations§
impl Freeze for PatternError
impl RefUnwindSafe for PatternError
impl Send for PatternError
impl Sync for PatternError
impl Unpin for PatternError
impl UnsafeUnpin for PatternError
impl UnwindSafe for PatternError
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