Struct regex_syntax::ast::Error
[−]
[src]
pub struct Error { /* fields omitted */ }
An error that occurred while parsing a regular expression into an abstract syntax tree.
Note that note all ASTs represents a valid regular expression. For example,
an AST is constructed without error for \p{Quux}
, but Quux
is not a
valid Unicode property name. That particular error is reported when
translating an AST to the high-level intermediate representation (HIR
).
Methods
impl Error
[src]
pub fn kind(&self) -> &ErrorKind
[src]
Return the type of this error.
pub fn pattern(&self) -> &str
[src]
The original pattern string in which this error occurred.
Every span reported by this error is reported in terms of this string.
pub fn span(&self) -> &Span
[src]
Return the span at which this error occurred.
pub fn auxiliary_span(&self) -> Option<&Span>
[src]
Return an auxiliary span. This span exists only for some errors that benefit from being able to point to two locations in the original regular expression. For example, "duplicate" errors will have the main error position set to the duplicate occurrence while its auxiliary span will be set to the initial occurrence.
Trait Implementations
impl Clone for Error
[src]
fn clone(&self) -> Error
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Debug for Error
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl Eq for Error
[src]
impl PartialEq for Error
[src]
fn eq(&self, __arg_0: &Error) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Error) -> bool
[src]
This method tests for !=
.
impl Error for Error
[src]
fn description(&self) -> &str
[src]
A short description of the error. Read more
fn cause(&self) -> Option<&Error>
1.0.0[src]
The lower-level cause of this error, if any. Read more
impl Display for Error
[src]
fn fmt(&self, f: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more