pub enum LunarMonth {
Show 24 variants
First,
LeapFirst,
Second,
LeapSecond,
Third,
LeapThird,
Fourth,
LeapFourth,
Fifth,
LeapFifth,
Sixth,
LeapSixth,
Seventh,
LeapSeventh,
Eighth,
LeapEighth,
Ninth,
LeapNinth,
Tenth,
LeapTenth,
Eleventh,
LeapEleventh,
Twelfth,
LeapTwelfth,
}
Expand description
列舉農曆十二個月份名稱:正月、二月、三月、四月、五月、六月、七月、八月、九月、十月、冬月、臘月。包含閏月。
Variants§
First
正月
LeapFirst
閏正月
Second
二月
LeapSecond
閏二月
Third
三月
LeapThird
閏三月
Fourth
四月
LeapFourth
閏四月
Fifth
五月
LeapFifth
閏五月
Sixth
六月
LeapSixth
閏六月
Seventh
七月
LeapSeventh
閏七月
Eighth
八月
LeapEighth
閏八月
Ninth
九月
LeapNinth
閏九月
Tenth
十月
LeapTenth
閏十月
Eleventh
冬月
LeapEleventh
閏冬月
Twelfth
臘月
LeapTwelfth
閏臘月
Implementations§
source§impl LunarMonth
impl LunarMonth
pub unsafe fn from_ordinal_unsafe(number: i8) -> LunarMonth
sourcepub fn to_str(&self, chinese_variant: ChineseVariant) -> &'static str
pub fn to_str(&self, chinese_variant: ChineseVariant) -> &'static str
取得 LunarMonth
列舉實體所代表的農曆月份字串。
sourcepub unsafe fn from_u8_unsafe(month: u8, leap: bool) -> LunarMonth
pub unsafe fn from_u8_unsafe(month: u8, leap: bool) -> LunarMonth
透過農曆月份數值和是否閏月來取得 LunarMonth
列舉實體。
sourcepub fn is_leap_month(&self) -> bool
pub fn is_leap_month(&self) -> bool
是否為閏月。
sourcepub fn get_total_days(&self, lunisolar_year: LunisolarYear) -> Option<u8>
pub fn get_total_days(&self, lunisolar_year: LunisolarYear) -> Option<u8>
傳入指定的農曆西曆年,並計算此農曆月在這個指定的農曆西曆年內共有幾天。
sourcepub fn get_ba_zi_weight(&self) -> u8
pub fn get_ba_zi_weight(&self) -> u8
取得八字重量。
Trait Implementations§
source§impl Clone for LunarMonth
impl Clone for LunarMonth
source§fn clone(&self) -> LunarMonth
fn clone(&self) -> LunarMonth
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for LunarMonth
impl Debug for LunarMonth
source§impl Display for LunarMonth
impl Display for LunarMonth
source§impl Hash for LunarMonth
impl Hash for LunarMonth
source§impl Ord for LunarMonth
impl Ord for LunarMonth
source§fn cmp(&self, other: &LunarMonth) -> Ordering
fn cmp(&self, other: &LunarMonth) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialEq<LunarMonth> for LunarMonth
impl PartialEq<LunarMonth> for LunarMonth
source§fn eq(&self, other: &LunarMonth) -> bool
fn eq(&self, other: &LunarMonth) -> bool
source§impl PartialOrd<LunarMonth> for LunarMonth
impl PartialOrd<LunarMonth> for LunarMonth
source§fn partial_cmp(&self, other: &LunarMonth) -> Option<Ordering>
fn partial_cmp(&self, other: &LunarMonth) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read more