pub enum LunarError {
InvalidSolarDate {
year: i32,
month: u8,
day: u8,
},
InvalidLunarDate {
year: i32,
month: u8,
day: u8,
is_leap_month: bool,
},
YearOutOfRange {
year: i32,
},
InvalidTime {
hour: u8,
minute: u8,
},
InvalidTimeIndex {
time_index: u8,
},
SolarTermOutOfRange {
year: i32,
},
}Expand description
Errors from date conversion and validation.
Variants§
InvalidSolarDate
The solar date is not a real calendar date.
InvalidLunarDate
The lunar date does not exist in that lunar year.
YearOutOfRange
The year falls outside the range covered by the generated tables.
InvalidTime
The time is not a valid 24-hour wall-clock time.
InvalidTimeIndex
The time index is outside the valid 0..=12 range (时辰 index).
SolarTermOutOfRange
The Gregorian year falls outside the generated solar-term table range.
Trait Implementations§
Source§impl Clone for LunarError
impl Clone for LunarError
Source§fn clone(&self) -> LunarError
fn clone(&self) -> LunarError
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 LunarError
impl Debug for LunarError
Source§impl Display for LunarError
impl Display for LunarError
impl Eq for LunarError
Source§impl Error for LunarError
impl Error for LunarError
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 PartialEq for LunarError
impl PartialEq for LunarError
Source§fn eq(&self, other: &LunarError) -> bool
fn eq(&self, other: &LunarError) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for LunarError
Auto Trait Implementations§
impl Freeze for LunarError
impl RefUnwindSafe for LunarError
impl Send for LunarError
impl Sync for LunarError
impl Unpin for LunarError
impl UnsafeUnpin for LunarError
impl UnwindSafe for LunarError
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