Struct regex_syntax::ast::Error [−][src]
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).
Fields
kind: ErrorKind
The kind of error.
pattern: String
The original pattern that the parser generated the error from. Every span in an error is a valid range into this string.
span: Span
The span of this error.
Methods
impl Error[src]
impl Errorpub fn kind(&self) -> &ErrorKind[src]
pub fn kind(&self) -> &ErrorKindReturn the type of this error.
pub fn pattern(&self) -> &str[src]
pub fn pattern(&self) -> &strThe 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]
pub fn span(&self) -> &SpanReturn the span at which this error occurred.
pub fn auxiliary_span(&self) -> Option<&Span>[src]
pub fn auxiliary_span(&self) -> Option<&Span>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]
impl Clone for Errorfn clone(&self) -> Error[src]
fn clone(&self) -> ErrorReturns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
fn clone_from(&mut self, source: &Self)Performs copy-assignment from source. Read more
impl Debug for Error[src]
impl Debug for Errorfn fmt(&self, f: &mut Formatter) -> Result[src]
fn fmt(&self, f: &mut Formatter) -> ResultFormats the value using the given formatter. Read more
impl Eq for Error[src]
impl Eq for Errorfn assert_receiver_is_total_eq(&self)[src]
fn assert_receiver_is_total_eq(&self)impl PartialEq for Error[src]
impl PartialEq for Errorfn eq(&self, other: &Error) -> bool[src]
fn eq(&self, other: &Error) -> boolThis method tests for self and other values to be equal, and is used by ==. Read more
fn ne(&self, other: &Error) -> bool[src]
fn ne(&self, other: &Error) -> boolThis method tests for !=.
impl Error for Error[src]
impl Error for Errorfn description(&self) -> &str[src]
fn description(&self) -> &strThis method is soft-deprecated. Read more
fn cause(&self) -> Option<&Error>1.0.0[src]
fn cause(&self) -> Option<&Error>The lower-level cause of this error, if any. Read more
fn type_id(&self) -> TypeId where
Self: 'static, [src]
fn type_id(&self) -> TypeId where
Self: 'static, 🔬 This is a nightly-only experimental API. (error_type_id)
unclear whether to commit to this public implementation detail
Get the TypeId of self
impl Display for Error[src]
impl Display for Errorfn fmt(&self, f: &mut Formatter) -> Result[src]
fn fmt(&self, f: &mut Formatter) -> ResultFormats the value using the given formatter. Read more
impl From<Error> for Error[src]
impl From<Error> for Errorimpl<'e> From<&'e Error> for Formatter<'e, ErrorKind>[src]
impl<'e> From<&'e Error> for Formatter<'e, ErrorKind>