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

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

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

Variants

HeartSpadeDiamondClub

Methods

impl Suit
[src]

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.

Trait Implementations

impl Debug for Suit
[src]

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

Formats the value using the given formatter.

impl Copy for Suit
[src]

impl Clone for Suit
[src]

fn clone(&self) -> Suit

Returns a copy of the value. Read more

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

Performs copy-assignment from source. Read more

impl PartialEq for Suit
[src]

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

This method tests for self and other values to be equal, and is used by ==. Read more

fn ne(&self, other: &Rhs) -> bool
1.0.0

This method tests for !=.

impl Encodable for Suit
[src]

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

impl Decodable for Suit
[src]

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

impl FromStr for Suit
[src]

type Err = String

The associated error which can be returned from parsing.

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

Parses a string s to return a value of this type. Read more