Enum libcoinche::cards::Suit [] [src]

pub enum Suit {
    Heart,
    Spade,
    Diamond,
    Club,
}

One of the four Suits: Heart, Spade, Diamond, Club.

Variants

Heart

The suit of hearts.

Spade

The suit of spades.

Diamond

The suit of diamonds.

Club

The suit of clubs.

Methods

impl Suit

fn from_n(n: u32) -> Self

Returns the suit corresponding to the number:

  • 0 -> Heart
  • 1 -> Spade
  • 2 -> Diamond
  • 3 -> Club

Panics

If n >= 4.

fn to_string(self) -> String

Returns a UTF-8 character representing the suit (♥, ♠, ♦ or ♣).

Trait Implementations

impl Encodable for Suit

fn encode<S: Encoder>(&self, s: &mut S) -> Result<(), S::Error>

impl Decodable for Suit

fn decode<D: Decoder>(d: &mut D) -> Result<Self, D::Error>

impl FromStr for Suit

type Err = String

fn from_str(s: &str) -> Result<Self, String>

Derived Implementations

impl Debug for Suit

fn fmt(&self, __arg_0: &mut Formatter) -> Result

impl Copy for Suit

impl Clone for Suit

fn clone(&self) -> Suit

fn clone_from(&mut self, source: &Self)

impl PartialEq for Suit

fn eq(&self, __arg_0: &Suit) -> bool

fn ne(&self, __arg_0: &Suit) -> bool