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 the given 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 the given 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 the given 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>
Source§fn with_year_and_doy(
&self,
year: u8,
day_of_year: u16,
) -> Result<Self, BadiDateError>
fn with_year_and_doy( &self, year: u8, day_of_year: u16, ) -> Result<Self, BadiDateError>
Source§impl<'de> Deserialize<'de> for BadiDate
impl<'de> Deserialize<'de> for BadiDate
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl HolyDayProviding for BadiDate
impl HolyDayProviding for BadiDate
Source§fn holy_day(&self) -> Option<BahaiHolyDay>
fn holy_day(&self) -> Option<BahaiHolyDay>
Gets the holy day for
self.day if it is a holy daySource§fn next_holy_day(&self) -> Result<Self, BadiDateError>
fn next_holy_day(&self) -> Result<Self, BadiDateError>
Gets the next holy day, if within the supported date range
Source§fn previous_holy_day(&self) -> Result<Self, BadiDateError>
fn previous_holy_day(&self) -> Result<Self, BadiDateError>
Gets the previous holy day, if within the supported date range
Source§impl Ord for BadiDate
impl Ord for BadiDate
Source§impl PartialOrd for BadiDate
impl PartialOrd for BadiDate
impl Eq 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)
If self.day == 1, returns the previous month’s Feast.Source§fn previous_or_current_feast(&self) -> T
fn previous_or_current_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)
If self.day == 1, returns self.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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more