pub trait IslamicBasedMarker {
const EPOCH: RataDie;
const DEBUG_NAME: &'static str;
const HAS_353_DAY_YEARS: bool;
// Required methods
fn fixed_from_islamic(year: i32, month: u8, day: u8) -> RataDie;
fn islamic_from_fixed(date: RataDie) -> (i32, u8, u8);
// Provided methods
fn mean_synodic_ny(extended_year: i32) -> RataDie { ... }
fn approximate_islamic_from_fixed(date: RataDie) -> i32 { ... }
fn month_lengths_for_year(extended_year: i32, ny: RataDie) -> [bool; 12] { ... }
}
Expand description
Common abstraction over islamic-style calendars
Required Associated Constants§
Sourceconst EPOCH: RataDie
const EPOCH: RataDie
The epoch of the calendar. Different calendars use a different epoch (Thu or Fri) due to disagreement on the exact date of Mohammed’s migration to Mecca.
Sourceconst DEBUG_NAME: &'static str
const DEBUG_NAME: &'static str
The name of the calendar for debugging.
Sourceconst HAS_353_DAY_YEARS: bool
const HAS_353_DAY_YEARS: bool
Whether this calendar is known to have 353-day years. This is probably a bug; see https://github.com/unicode-org/icu4x/issues/4930
Required Methods§
Provided Methods§
Sourcefn mean_synodic_ny(extended_year: i32) -> RataDie
fn mean_synodic_ny(extended_year: i32) -> RataDie
Given the extended year, calculate the approximate new year using the mean synodic month
Sourcefn approximate_islamic_from_fixed(date: RataDie) -> i32
fn approximate_islamic_from_fixed(date: RataDie) -> i32
Given an iso date, calculate the approximate islamic year it corresponds to (for quick cache lookup)
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.