pub enum ParseErrorKind {
FormatMismatch,
InvalidNumber,
InvalidDateValue,
InvalidTimeValue,
UnsupportedSpecifier,
InvalidMonthName,
InvalidWeekdayName,
}Expand description
Provides specific reasons for a parsing failure.
This enum is wrapped by DateError::ParseError to give detailed feedback when
parsing a string into a date or date-time fails.
Variants§
FormatMismatch
The input string’s structure or literal characters did not match the format string.
For example, expecting a / but finding a -, or the input string has trailing characters.
InvalidNumber
A numeric component (e.g., %Y, %m, %d, %H) contained non-digit characters,
or did not have the required number of digits.
InvalidDateValue
The components were parsed successfully but form a logically invalid date.
For example, parsing "1404/12/30" with "%Y/%m/%d", where 1404 is not a leap year.
InvalidTimeValue
The components were parsed successfully but form a logically invalid time.
For example, parsing "25:10:00" with "%H:%M:%S".
UnsupportedSpecifier
The format string contained an unrecognized or unsupported specifier for parsing.
For example, using %A (weekday name) or %j (ordinal day), which are for formatting only.
InvalidMonthName
A Persian month name required by the %B specifier was not found or recognized in the input.
InvalidWeekdayName
Reserved for future use if weekday parsing is implemented. Currently not returned.
Trait Implementations§
Source§impl Clone for ParseErrorKind
impl Clone for ParseErrorKind
Source§fn clone(&self) -> ParseErrorKind
fn clone(&self) -> ParseErrorKind
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more