pub struct Error<Kind, Context> { /* private fields */ }Expand description
An error that has a Kind and optional list of Context instances.
The Kind represents the original root cause of the error, whereas
the Context type provides additional information.
Implementations§
Source§impl<K, T> Error<ErrorKind<K, T>, Context>
impl<K, T> Error<ErrorKind<K, T>, Context>
Sourcepub fn end_of_stream() -> ParseError<K, T>
pub fn end_of_stream() -> ParseError<K, T>
Creates a new ParseError with the kind ErrorKind::EndOfStream.
Sourcepub fn unexpected(span: Span, got: T, expected: String) -> ParseError<K, T>
pub fn unexpected(span: Span, got: T, expected: String) -> ParseError<K, T>
Creates a new ParseError with the kind ErrorKind::UnexpectedToken.
Sourcepub fn other(span: Span, kind: K) -> ParseError<K, T>
pub fn other(span: Span, kind: K) -> ParseError<K, T>
Creates a new ParseError from an parser of format specific error type. The returned parse error will have a kind of ErrorKind::Other, with the kind set to the provided value.
Trait Implementations§
Auto Trait Implementations§
impl<Kind, Context> Freeze for Error<Kind, Context>where
Kind: Freeze,
impl<Kind, Context> RefUnwindSafe for Error<Kind, Context>where
Kind: RefUnwindSafe,
Context: RefUnwindSafe,
impl<Kind, Context> Send for Error<Kind, Context>
impl<Kind, Context> Sync for Error<Kind, Context>
impl<Kind, Context> Unpin for Error<Kind, Context>
impl<Kind, Context> UnsafeUnpin for Error<Kind, Context>where
Kind: UnsafeUnpin,
impl<Kind, Context> UnwindSafe for Error<Kind, Context>where
Kind: UnwindSafe,
Context: 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