pub enum Zodiac {
Rat,
Ox,
Tiger,
Rabbit,
Dragon,
Snake,
Horse,
Goat,
Monkey,
Rooster,
Dog,
Pig,
}
Expand description
列舉中國十二生肖:鼠、牛、虎、兔、龍、蛇、馬、羊、猴、雞、狗、豬。
Variants§
Implementations§
source§impl Zodiac
impl Zodiac
pub unsafe fn from_ordinal_unsafe(number: i8) -> Zodiac
sourcepub fn from_str<S: AsRef<str>>(s: S) -> Option<Zodiac>
pub fn from_str<S: AsRef<str>>(s: S) -> Option<Zodiac>
透過鼠、牛、虎、兔、龍、蛇、馬、羊、猴、雞、狗、豬等字串來取得 Zodiac
列舉實體。
sourcepub fn to_str(&self, chinese_variant: ChineseVariant) -> &'static str
pub fn to_str(&self, chinese_variant: ChineseVariant) -> &'static str
取得 Zodiac
列舉實體所代表的生肖字串。
sourcepub fn to_char(&self, chinese_variant: ChineseVariant) -> char
pub fn to_char(&self, chinese_variant: ChineseVariant) -> char
取得 Zodiac
列舉實體所代表的生肖字元。
sourcepub fn from_earthly_branch(earthly_branch: EarthlyBranch) -> Zodiac
pub fn from_earthly_branch(earthly_branch: EarthlyBranch) -> Zodiac
透過地支來取得生肖。
sourcepub fn to_earthly_branch(&self) -> EarthlyBranch
pub fn to_earthly_branch(&self) -> EarthlyBranch
將生肖轉成地支。
Trait Implementations§
source§impl From<EarthlyBranch> for Zodiac
impl From<EarthlyBranch> for Zodiac
source§fn from(earthly_branch: EarthlyBranch) -> Zodiac
fn from(earthly_branch: EarthlyBranch) -> Zodiac
Converts to this type from the input type.
source§impl From<Zodiac> for EarthlyBranch
impl From<Zodiac> for EarthlyBranch
source§fn from(zodiac: Zodiac) -> EarthlyBranch
fn from(zodiac: Zodiac) -> EarthlyBranch
Converts to this type from the input type.
source§impl Ord for Zodiac
impl Ord for Zodiac
source§impl PartialOrd<Zodiac> for Zodiac
impl PartialOrd<Zodiac> for Zodiac
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