pub enum Error<E = Infallible> {
Stream(usize, E),
Unexpected(usize, Option<char>),
InvalidUnicodeCodePoint(Span, u32),
MissingLowSurrogate(Span, u16),
InvalidLowSurrogate(Span, u16, u32),
InvalidUtf8(usize),
}
Expand description
Parse error.
Variants§
Stream(usize, E)
Stream error.
The first parameter is the byte index at which the error occurred.
Unexpected(usize, Option<char>)
Unexpected character or end of stream.
The first parameter is the byte index at which the error occurred.
InvalidUnicodeCodePoint(Span, u32)
Invalid unicode codepoint.
The first parameter is the span at which the error occurred.
MissingLowSurrogate(Span, u16)
Missing low surrogate in a string.
The first parameter is the byte index at which the error occurred.
InvalidLowSurrogate(Span, u16, u32)
Invalid low surrogate in a string.
The first parameter is the span at which the error occurred.
InvalidUtf8(usize)
UTF-8 encoding error.
Implementations§
Trait Implementations§
Source§impl<E: 'static + Error> Error for Error<E>
impl<E: 'static + Error> Error for Error<E>
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()
Auto Trait Implementations§
impl<E> Freeze for Error<E>where
E: Freeze,
impl<E> RefUnwindSafe for Error<E>where
E: RefUnwindSafe,
impl<E> Send for Error<E>where
E: Send,
impl<E> Sync for Error<E>where
E: Sync,
impl<E> Unpin for Error<E>where
E: Unpin,
impl<E> UnwindSafe for Error<E>where
E: UnwindSafe,
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