pub struct BadiDate { /* private fields */ }Expand description
A structure that holds a date in the Badí‘ (Bahá’í) calendar without time zone or location info
Implementations§
Trait Implementations§
source§impl BadiDateLike for BadiDate
impl BadiDateLike for BadiDate
source§fn year(&self) -> u8
fn year(&self) -> u8
The Bahá’í Era/Badi year [1 - 221 supported] (year 1 starts 21 March 1844)
source§fn day_of_year(&self) -> u16
fn day_of_year(&self) -> u16
The day of the current year (starting with 1 on Naw-Rúz)
source§fn with_day(&self, day: u16) -> Result<BadiDate, BadiDateError>
fn with_day(&self, day: u16) -> Result<BadiDate, BadiDateError>
Returns new
BadiDateLike with a different day (checks input for validity)source§fn with_month(&self, month: BadiMonth) -> Result<BadiDate, BadiDateError>
fn with_month(&self, month: BadiMonth) -> Result<BadiDate, BadiDateError>
Returns new
BadiDateLike with a different month (checks input for validity)source§fn with_year(&self, year: u8) -> Result<Self, BadiDateError>
fn with_year(&self, year: u8) -> Result<Self, BadiDateError>
Returns new
BadiDateLike with a different year (checks input for validity)source§fn with_ymd(
&self,
year: u8,
month: BadiMonth,
day: u16,
) -> Result<BadiDate, BadiDateError>
fn with_ymd( &self, year: u8, month: BadiMonth, day: u16, ) -> Result<BadiDate, BadiDateError>
Returns new
BadiDateLike with a different year, month, and day (checks input for validity)source§impl PartialEq for BadiDate
impl PartialEq for BadiDate
impl StructuralPartialEq for BadiDate
Auto Trait Implementations§
impl Freeze for BadiDate
impl RefUnwindSafe for BadiDate
impl Send for BadiDate
impl Sync for BadiDate
impl Unpin for BadiDate
impl UnwindSafe for BadiDate
Blanket Implementations§
source§impl<T> BadiDateOps<T> for Twhere
T: BadiDateLike,
impl<T> BadiDateOps<T> for Twhere
T: BadiDateLike,
source§fn next_feast(&self) -> T
fn next_feast(&self) -> T
source§fn previous_feast(&self) -> T
fn previous_feast(&self) -> T
Returns new
BadiDateLike of the previous Feast (day 1 of BadiMonth::Month – self.month is kept if self.day > 1), skips BadiMonth::AyyamIHa)source§fn previous_day(&self) -> T
fn previous_day(&self) -> T
Convenience method to goto previous Badi day
source§fn next_month(&self, skip_ayyamiha: bool) -> T
fn next_month(&self, skip_ayyamiha: bool) -> T
Convenience method to goto next Badi month
source§fn previous_month(&self, skip_ayyamiha: bool) -> T
fn previous_month(&self, skip_ayyamiha: bool) -> T
Convenience method to goto previous Badi month
source§fn add_months(
&self,
months: i32,
day_change_action: DayChangeAction,
skip_ayyamiha: bool,
) -> T
fn add_months( &self, months: i32, day_change_action: DayChangeAction, skip_ayyamiha: bool, ) -> T
source§fn add_days(&self, days: i32) -> T
fn add_days(&self, days: i32) -> T
Returns new
BadiDateLike with number of days added (subtracted if negative) (increments month and year accordingly; includes BadiMonth::AyyamIHa)source§fn next_naw_ruz(&self) -> T
fn next_naw_ruz(&self) -> T
source§fn previous_naw_ruz(&self) -> T
fn previous_naw_ruz(&self) -> T
Returns new
BadiDateLike of the previous Naw Ruz (day 1 of BadiMonth::Month(1) – self.year is kept if self > current Naw Ruz)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