pub struct LexError {
pub message: String,
pub offset: usize,
pub len: usize,
pub line_column: Option<LineColumn>,
}Expand description
A lexical diagnostic (e.g. an unterminated literal), located at a byte span.
Fields§
§message: String§offset: usizeByte offset into the source where the offending token began.
len: usizeByte length of the offending token’s text, so a diagnostic can underline the whole token
rather than a single character. May be 0 for a zero-width point at end of input.
line_column: Option<LineColumn>One-based line/column position, when the full source text was available.
Implementations§
Trait Implementations§
impl Eq for LexError
Source§impl Error for LexError
impl Error for LexError
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()
impl StructuralPartialEq for LexError
Auto Trait Implementations§
impl Freeze for LexError
impl RefUnwindSafe for LexError
impl Send for LexError
impl Sync for LexError
impl Unpin for LexError
impl UnsafeUnpin for LexError
impl UnwindSafe for LexError
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