pub enum DateError {
DateTooEarly,
InvalidDayOfYear,
DateNotUTC,
InvalidCalendarDate,
InvalidTimeOfDay,
}Expand description
Date conversion errors
Errors that can occur during Julian-date and day-of-year conversions.
§Examples
use mako_sgp4::time::{DateError, DateTime, Timezone, utc2jday};
// Julian conversion requires UTC
let datetime = DateTime {
year: 2000,
month: 1,
day: 1,
hour: 12,
minute: 0,
second: 0.0,
timezone: Timezone::UT1,
};
// Assert the non-UTC error
let err = utc2jday(&datetime).unwrap_err();
assert_eq!(err, DateError::DateNotUTC);§References
Variants§
DateTooEarly
The provided date is before October 10th, 1582 (Gregorian calendar adoption)
InvalidDayOfYear
The day of year is invalid (less than 1 or greater than 365/366)
DateNotUTC
The datetime is not in UTC
InvalidCalendarDate
The month is outside 1-12 or the day is outside the days in that month
InvalidTimeOfDay
The hour, minute, or second is outside its range (0-23, 0-59, 0.0 to less than 61.0)
Trait Implementations§
impl StructuralPartialEq for DateError
Auto Trait Implementations§
impl Freeze for DateError
impl RefUnwindSafe for DateError
impl Send for DateError
impl Sync for DateError
impl Unpin for DateError
impl UnsafeUnpin for DateError
impl UnwindSafe for DateError
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