pub enum Error<E = !> {
Stream(usize, E),
Unexpected(usize, Option<char>),
InvalidUnicodeCodePoint(Span, u32),
MissingLowSurrogate(Span, u32),
InvalidLowSurrogate(Span, u32, 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, u32)
Missing low surrogate in a string.
The first parameter is the byte index at which the error occurred.
InvalidLowSurrogate(Span, u32, 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> Error for Error<E>where
E: 'static + Error,
impl<E> Error for Error<E>where
E: 'static + Error,
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> UnsafeUnpin for Error<E>where
E: UnsafeUnpin,
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
Source§impl<T> BorrowUnordered for T
impl<T> BorrowUnordered for T
Source§fn as_unordered(&self) -> &Unordered<T>
fn as_unordered(&self) -> &Unordered<T>
Views this value as an
Unordered reference.impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T, U, C> IntoWithContext<U, C> for Twhere
U: FromWithContext<T, C>,
impl<T, U, C> IntoWithContext<U, C> for Twhere
U: FromWithContext<T, C>,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
Fallible version of
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
Converts the given value to a
CompactString. Read more