#[non_exhaustive]pub enum CharClassError {
Empty,
CaretInGroup,
NonAscendingRange(char, char),
Invalid,
Unallowed,
UnknownNamedClass {
found: Box<str>,
},
Negative,
}
Expand description
An error that relates to a character class
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.
Empty
Empty character class, i.e. []
CaretInGroup
This error is created when [^
is encountered. This is a negated
character class in a regex, but pomsky instead uses the ![
syntax.
NonAscendingRange(char, char)
Non-ascending code point range, e.g. ['z'-'a']
Invalid
Invalid token within a character class
Unallowed
Character class contains incompatible shorthands, e.g. [. codepoint]
UnknownNamedClass
Unknown shorthand character class or Unicode property
Negative
A character class that can’t be negated, e.g. [!ascii]
Trait Implementations§
Source§impl Clone for CharClassError
impl Clone for CharClassError
Source§fn clone(&self) -> CharClassError
fn clone(&self) -> CharClassError
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 CharClassError
impl Debug for CharClassError
Source§impl Display for CharClassError
impl Display for CharClassError
Source§impl Error for CharClassError
impl Error for CharClassError
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 From<CharClassError> for ParseErrorKind
impl From<CharClassError> for ParseErrorKind
Source§fn from(e: CharClassError) -> Self
fn from(e: CharClassError) -> Self
Converts to this type from the input type.
Source§impl PartialEq for CharClassError
impl PartialEq for CharClassError
impl Eq for CharClassError
impl StructuralPartialEq for CharClassError
Auto Trait Implementations§
impl Freeze for CharClassError
impl RefUnwindSafe for CharClassError
impl Send for CharClassError
impl Sync for CharClassError
impl Unpin for CharClassError
impl UnwindSafe for CharClassError
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