pub enum Suit {
None = 0,
Club = 1,
Diamond = 2,
Heart = 3,
Spade = 4,
}
Expand description
wiki | Simple integer enum. Specific numbers do matter: I do a lot of math with them to optimize things, and the same numbers are used in the other languages in the project.
Variants§
None = 0
Not valid suit, only used internally for special cases.
Club = 1
Clubs / Batons / Acorns / Wands
Diamond = 2
Diamonds / Coins / Bells / Pentacles
Heart = 3
Hearts / Cups / Roses
Spade = 4
Spades / Swords / Leaves / Shields
Implementations§
source§impl Suit
impl Suit
sourcepub const fn from_i32_const(v: i32) -> Option<Suit>
pub const fn from_i32_const(v: i32) -> Option<Suit>
Convert integer to suit.
sourcepub fn from_char(c: char) -> aResult<Suit>
pub fn from_char(c: char) -> aResult<Suit>
Accept ASCII text or Unicode solid/black suit symbols U+2660, U+2665, U+2666, U+2663
Trait Implementations§
source§impl Ord for Suit
impl Ord for Suit
source§impl PartialEq for Suit
impl PartialEq for Suit
source§impl PartialOrd for Suit
impl PartialOrd for Suit
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 moreimpl Copy for Suit
impl Eq for Suit
impl StructuralPartialEq for Suit
Auto Trait Implementations§
impl Freeze for Suit
impl RefUnwindSafe for Suit
impl Send for Suit
impl Sync for Suit
impl Unpin for Suit
impl UnwindSafe for Suit
Blanket Implementations§
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: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)