pub struct LexErrorDisplay<'a> {
pub error: &'a LexError,
pub input: &'a str,
}Expand description
Diagnostic formatter that renders a LexError alongside the original markup input.
Formats output in the style of the Rust compiler: the input string on one line, followed by
a caret (^) on the next line aligned to the byte offset stored in the error variant.
§Example
| [bold unknown]text[/]
| ^^^^ invalid tag: 'bold unknown'Fields§
§error: &'a LexErrorThe error to render.
input: &'a strThe full markup string that was being tokenized when the error occurred.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for LexErrorDisplay<'a>
impl<'a> RefUnwindSafe for LexErrorDisplay<'a>
impl<'a> Send for LexErrorDisplay<'a>
impl<'a> Sync for LexErrorDisplay<'a>
impl<'a> Unpin for LexErrorDisplay<'a>
impl<'a> UnsafeUnpin for LexErrorDisplay<'a>
impl<'a> UnwindSafe for LexErrorDisplay<'a>
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