Enum fundu::ParseError
source · #[non_exhaustive]pub enum ParseError {
Empty,
Syntax(usize, String),
Overflow,
TimeUnit(usize, String),
NegativeExponentOverflow,
PositiveExponentOverflow,
NegativeNumber,
InvalidInput(String),
}
Expand description
Error type emitted during the parsing
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Empty
Returned, if the input was empty.
Syntax(usize, String)
A syntax error. Syntax errors report the position (column) where it was encountered and a reason.
Overflow
Currently only used internally for overflows of the maximum Duration.
TimeUnit(usize, String)
An error concerning time units. Like ParseError::Syntax
the position where the error
occurred is included.
NegativeExponentOverflow
The exponent exceeded the minimum negative exponent (-32768
)
PositiveExponentOverflow
The exponent exceeded the maximum positive exponent (+32767
)
NegativeNumber
The input number was negative. Note that numbers close to 0
(< 1e-18) are not negative but resolve to
0`
InvalidInput(String)
A generic error if no other error type fits
Trait Implementations§
source§impl Debug for ParseError
impl Debug for ParseError
source§impl Display for ParseError
impl Display for ParseError
source§impl Error for ParseError
impl Error for ParseError
1.30.0 · source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
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 PartialEq<ParseError> for ParseError
impl PartialEq<ParseError> for ParseError
source§fn eq(&self, other: &ParseError) -> bool
fn eq(&self, other: &ParseError) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Eq for ParseError
impl StructuralEq for ParseError
impl StructuralPartialEq for ParseError
Auto Trait Implementations§
impl RefUnwindSafe for ParseError
impl Send for ParseError
impl Sync for ParseError
impl Unpin for ParseError
impl UnwindSafe for ParseError
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