[][src]Enum heca_lib::prelude::ConversionError

pub enum ConversionError {
    IsNotLeapYear,
    TooManyDaysInMonth(u8),
    IsLeapYear,
    YearTooSmall,
}

Occurs when failing to get a Hebrew Date.

Variants

IsNotLeapYear

Occurs 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));
IsLeapYear

Occurs 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);
YearTooSmall

Occurs 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 Clone for ConversionError[src]

impl Copy for ConversionError[src]

impl Debug for ConversionError[src]

impl<'de> Deserialize<'de> for ConversionError[src]

impl Display for ConversionError[src]

impl Eq for ConversionError[src]

impl Error for ConversionError[src]

impl PartialEq<ConversionError> for ConversionError[src]

impl Serialize for ConversionError[src]

impl StructuralEq for ConversionError[src]

impl StructuralPartialEq for ConversionError[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.