pub enum Zodiac {
Rat,
Ox,
Tiger,
Rabbit,
Dragon,
Snake,
Horse,
Goat,
Monkey,
Rooster,
Dog,
Pig,
}
Expand description
列舉中國十二生肖:鼠、牛、虎、兔、龍、蛇、馬、羊、猴、雞、狗、豬。
Variants
Rat
鼠
Ox
牛
Tiger
虎
Rabbit
兔
Dragon
龍
Snake
蛇
Horse
馬
Goat
羊
Monkey
猴
Rooster
雞
Dog
狗
Pig
豬
Implementations
sourceimpl 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
sourceimpl From<EarthlyBranch> for Zodiac
impl From<EarthlyBranch> for Zodiac
sourcefn from(earthly_branch: EarthlyBranch) -> Zodiac
fn from(earthly_branch: EarthlyBranch) -> Zodiac
Converts to this type from the input type.
sourceimpl From<Zodiac> for EarthlyBranch
impl From<Zodiac> for EarthlyBranch
sourcefn from(zodiac: Zodiac) -> EarthlyBranch
fn from(zodiac: Zodiac) -> EarthlyBranch
Converts to this type from the input type.
sourceimpl Ord for Zodiac
impl Ord for Zodiac
sourceimpl PartialOrd<Zodiac> for Zodiac
impl PartialOrd<Zodiac> for Zodiac
sourcefn partial_cmp(&self, other: &Zodiac) -> Option<Ordering>
fn partial_cmp(&self, other: &Zodiac) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn 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
impl Copy for Zodiac
impl Eq for Zodiac
impl StructuralEq for Zodiac
impl StructuralPartialEq for Zodiac
Auto Trait Implementations
impl RefUnwindSafe for Zodiac
impl Send for Zodiac
impl Sync for Zodiac
impl Unpin for Zodiac
impl UnwindSafe for Zodiac
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more