Struct regex_syntax::error::Formatter
source · pub struct Formatter<'e, E> {
pattern: &'e str,
err: &'e E,
span: &'e Span,
aux_span: Option<&'e Span>,
}
Expand description
A helper type for formatting nice error messages.
This type is responsible for reporting regex parse errors in a nice human readable format. Most of its complexity is from interspersing notational markers pointing out the position where an error occurred.
Fields§
§pattern: &'e str
The original regex pattern in which the error occurred.
err: &'e E
The error kind. It must impl fmt::Display.
span: &'e Span
The primary span of the error.
aux_span: Option<&'e Span>
An auxiliary and optional span, in case the error needs to point to two locations (e.g., when reporting a duplicate capture group name).
Trait Implementations§
Auto Trait Implementations§
impl<'e, E> Freeze for Formatter<'e, E>
impl<'e, E> RefUnwindSafe for Formatter<'e, E>where
E: RefUnwindSafe,
impl<'e, E> Send for Formatter<'e, E>where
E: Sync,
impl<'e, E> Sync for Formatter<'e, E>where
E: Sync,
impl<'e, E> Unpin for Formatter<'e, E>
impl<'e, E> UnwindSafe for Formatter<'e, E>where
E: RefUnwindSafe,
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