[−][src]Enum heca_lib::prelude::ConversionError
Occurs when failing to get a Hebrew Date.
Variants
IsNotLeapYearOccurs when attempting to get an Adar 1 or Adar 2 in a non-leap year.
Example:
let result = HebrewDate::from_ymd(5778,HebrewMonth::Adar1,NonZeroI8::new(1).unwrap()); assert!(!result.is_ok()); assert_eq!(result.unwrap_err(),ConversionError::IsNotLeapYear);
TooManyDaysInMonth(u8)Occurs when trying to get a Hebrew Date who's day is out of range
Example:
let result = HebrewDate::from_ymd(5778,HebrewMonth::Adar,NonZeroI8::new(40).unwrap()); assert!(!result.is_ok()); assert_eq!(result.unwrap_err(),ConversionError::TooManyDaysInMonth(29));
IsLeapYearOccurs when attempting to get a regular Adar in a leap year.
Example:
let result = HebrewDate::from_ymd(5779,HebrewMonth::Adar,NonZeroI8::new(1).unwrap()); assert!(!result.is_ok()); assert_eq!(result.unwrap_err(),ConversionError::IsLeapYear);
YearTooSmallOccurs when attempting to get a year that is before the epoch (currently: year 3764/4).
Example:
let result = HebrewDate::from_ymd(2448,HebrewMonth::Nissan,NonZeroI8::new(15).unwrap()); // What was the English day of the Exodus? assert!(!result.is_ok()); assert_eq!(result.unwrap_err(),ConversionError::YearTooSmall);
Trait Implementations
impl PartialEq<ConversionError> for ConversionError[src]
fn eq(&self, other: &ConversionError) -> bool[src]
fn ne(&self, other: &ConversionError) -> bool[src]
impl Clone for ConversionError[src]
fn clone(&self) -> ConversionError[src]
fn clone_from(&mut self, source: &Self)1.0.0[src]
Performs copy-assignment from source. Read more
impl Eq for ConversionError[src]
impl Copy for ConversionError[src]
impl Debug for ConversionError[src]
impl Display for ConversionError[src]
impl Error for ConversionError[src]
fn description(&self) -> &str1.0.0[src]
This method is soft-deprecated. Read more
fn cause(&self) -> Option<&dyn Error>1.0.0[src]
Deprecated since 1.33.0:
replaced by Error::source, which can support downcasting
The lower-level cause of this error, if any. Read more
fn source(&self) -> Option<&(dyn Error + 'static)>1.30.0[src]
The lower-level source of this error, if any. Read more
impl Serialize for ConversionError[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer, [src]
__S: Serializer,
impl<'de> Deserialize<'de> for ConversionError[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>, [src]
__D: Deserializer<'de>,
Auto Trait Implementations
impl Send for ConversionError
impl Sync for ConversionError
Blanket Implementations
impl<T> From<T> for T[src]
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T[src]
fn clone_into(&self, target: &mut T)[src]
impl<T> ToString for T where
T: Display + ?Sized, [src]
T: Display + ?Sized,
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> DeserializeOwned for T where
T: Deserialize<'de>, [src]
T: Deserialize<'de>,