pub enum ParseErrorKind {
ExpectedValue,
Complex(ParseComplexError),
Char(ParseCharError),
String(ParseStringError),
Number(ParseNumberError),
BitSequence(ParseBitSequenceError),
Custom(String),
}
Expand description
Details about the error that occurred.
Variants§
ExpectedValue
Complex(ParseComplexError)
Char(ParseCharError)
String(ParseStringError)
Number(ParseNumberError)
BitSequence(ParseBitSequenceError)
Custom(String)
Implementations§
Source§impl ParseErrorKind
impl ParseErrorKind
Sourcepub fn at(self, loc: usize) -> ParseError
pub fn at(self, loc: usize) -> ParseError
Error at a specific location with no specific end
Sourcepub fn at_one(self, loc: usize) -> ParseError
pub fn at_one(self, loc: usize) -> ParseError
Error at a specific location for the next character
Sourcepub fn between(self, start: usize, end: usize) -> ParseError
pub fn between(self, start: usize, end: usize) -> ParseError
Error between two locations.
Source§impl ParseErrorKind
impl ParseErrorKind
Sourcepub fn custom<T: Display>(value: T) -> Self
pub fn custom<T: Display>(value: T) -> Self
Construct a custom error from a type implementing core::fmt::Display
.
Sourcepub fn custom_debug<T: Debug>(value: T) -> Self
pub fn custom_debug<T: Debug>(value: T) -> Self
Construct a custom error from a type implementing Debug
.
Prefer ParseErrorKind::custom
where possible.
Trait Implementations§
Source§impl Debug for ParseErrorKind
impl Debug for ParseErrorKind
Source§impl Display for ParseErrorKind
impl Display for ParseErrorKind
Source§impl Error for ParseErrorKind
impl Error for ParseErrorKind
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 From<ParseBitSequenceError> for ParseErrorKind
impl From<ParseBitSequenceError> for ParseErrorKind
Source§fn from(source: ParseBitSequenceError) -> Self
fn from(source: ParseBitSequenceError) -> Self
Converts to this type from the input type.
Source§impl From<ParseCharError> for ParseErrorKind
impl From<ParseCharError> for ParseErrorKind
Source§fn from(source: ParseCharError) -> Self
fn from(source: ParseCharError) -> Self
Converts to this type from the input type.
Source§impl From<ParseComplexError> for ParseErrorKind
impl From<ParseComplexError> for ParseErrorKind
Source§fn from(source: ParseComplexError) -> Self
fn from(source: ParseComplexError) -> Self
Converts to this type from the input type.
Source§impl From<ParseNumberError> for ParseErrorKind
impl From<ParseNumberError> for ParseErrorKind
Source§fn from(source: ParseNumberError) -> Self
fn from(source: ParseNumberError) -> Self
Converts to this type from the input type.
Source§impl From<ParseStringError> for ParseErrorKind
impl From<ParseStringError> for ParseErrorKind
Source§fn from(source: ParseStringError) -> Self
fn from(source: ParseStringError) -> Self
Converts to this type from the input type.
Source§impl From<String> for ParseErrorKind
impl From<String> for ParseErrorKind
Source§impl PartialEq for ParseErrorKind
impl PartialEq for ParseErrorKind
impl Eq for ParseErrorKind
impl StructuralPartialEq for ParseErrorKind
Auto Trait Implementations§
impl Freeze for ParseErrorKind
impl RefUnwindSafe for ParseErrorKind
impl Send for ParseErrorKind
impl Sync for ParseErrorKind
impl Unpin for ParseErrorKind
impl UnwindSafe for ParseErrorKind
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more