pub struct ParseError<E> {
pub kind: ParseErrorKind<E>,
}Expand description
Extensible parse errors that can be encountered by client parsing implementations.
Fields§
§kind: ParseErrorKind<E>Details of this error
Implementations§
Source§impl<T> ParseError<T>
impl<T> ParseError<T>
Sourcepub fn from_basic_kind(kind: BasicParseErrorKind) -> Self
pub fn from_basic_kind(kind: BasicParseErrorKind) -> Self
Create a new ParseError from a basic error kind.
Sourcepub fn unexpected_token() -> Self
pub fn unexpected_token() -> Self
Create a new ParseError for an unexpected token.
Sourcepub fn custom<E: Into<T>>(error: E) -> Self
pub fn custom<E: Into<T>>(error: E) -> Self
Create a new ParseError from a consumer-defined error.
Sourcepub fn basic(self) -> BasicParseError
pub fn basic(self) -> BasicParseError
Extract the fundamental parse error from an extensible error.
Sourcepub fn into<U>(self) -> ParseError<U>where
T: Into<U>,
pub fn into<U>(self) -> ParseError<U>where
T: Into<U>,
Like std::convert::Into::into
Trait Implementations§
Source§impl<E: Clone> Clone for ParseError<E>
impl<E: Clone> Clone for ParseError<E>
Source§fn clone(&self) -> ParseError<E>
fn clone(&self) -> ParseError<E>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<E: Debug> Debug for ParseError<E>
impl<E: Debug> Debug for ParseError<E>
Source§impl<E: Display> Display for ParseError<E>
impl<E: Display> Display for ParseError<E>
Source§impl<E: Display + Debug> Error for ParseError<E>
impl<E: Display + Debug> Error for ParseError<E>
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()
Source§impl<T> From<BasicParseError> for ParseError<T>
impl<T> From<BasicParseError> for ParseError<T>
Source§fn from(this: BasicParseError) -> ParseError<T>
fn from(this: BasicParseError) -> ParseError<T>
Converts to this type from the input type.
Source§impl<E: PartialEq> PartialEq for ParseError<E>
impl<E: PartialEq> PartialEq for ParseError<E>
impl<E: PartialEq> StructuralPartialEq for ParseError<E>
Auto Trait Implementations§
impl<E> Freeze for ParseError<E>where
ParseErrorKind<E>: Freeze,
impl<E> RefUnwindSafe for ParseError<E>where
ParseErrorKind<E>: RefUnwindSafe,
impl<E> Send for ParseError<E>where
ParseErrorKind<E>: Send,
impl<E> Sync for ParseError<E>where
ParseErrorKind<E>: Sync,
impl<E> Unpin for ParseError<E>where
ParseErrorKind<E>: Unpin,
impl<E> UnsafeUnpin for ParseError<E>where
ParseErrorKind<E>: UnsafeUnpin,
impl<E> UnwindSafe for ParseError<E>where
ParseErrorKind<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