pub enum DateTimeError {
InvalidMonth(u8),
InvalidDay {
year: i32,
month: u8,
day: u8,
max_days: u8,
},
InvalidHour(u8),
InvalidMinute(u8),
InvalidSecond(u8),
InvalidMillisecond(u16),
InvalidTimezoneOffset(i16),
}Expand description
Errors in date or time construction and validation.
Variants§
InvalidMonth(u8)
Month is not in the range 1..=12.
InvalidDay
Day is not valid for the given month and year.
InvalidHour(u8)
Hour is not in the range 0..=23.
InvalidMinute(u8)
Minute is not in the range 0..=59.
InvalidSecond(u8)
Second is not in the range 0..=59.
InvalidMillisecond(u16)
Millisecond is not in the range 0..=999.
InvalidTimezoneOffset(i16)
Timezone offset in minutes is not in the range -720..=840 (-12h..+14h).
Trait Implementations§
Source§impl Clone for DateTimeError
impl Clone for DateTimeError
Source§fn clone(&self) -> DateTimeError
fn clone(&self) -> DateTimeError
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 Debug for DateTimeError
impl Debug for DateTimeError
Source§impl Display for DateTimeError
impl Display for DateTimeError
impl Eq for DateTimeError
Source§impl Error for DateTimeError
impl Error for DateTimeError
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 From<DateTimeError> for FormattingError
impl From<DateTimeError> for FormattingError
Source§fn from(err: DateTimeError) -> FormattingError
fn from(err: DateTimeError) -> FormattingError
Converts to this type from the input type.
Source§impl PartialEq for DateTimeError
impl PartialEq for DateTimeError
impl StructuralPartialEq for DateTimeError
Auto Trait Implementations§
impl Freeze for DateTimeError
impl RefUnwindSafe for DateTimeError
impl Send for DateTimeError
impl Sync for DateTimeError
impl Unpin for DateTimeError
impl UnsafeUnpin for DateTimeError
impl UnwindSafe for DateTimeError
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