Enum deckofcards::Suit
[−]
[src]
pub enum Suit { Spades, Hearts, Diamonds, Clubs, }
This enumeration holds the suits in a standard deck of cards.
Variants
Spades
Hearts
Diamonds
Clubs
Methods
impl Suit
[src]
fn iterator() -> Iter<'static, Suit>
Returns an iterator through the standard suits
fn ordinal(&self) -> usize
Returns an ordinal for the suit
fn from_char(ch: char) -> Result<Suit, &'static str>
Returns a Suit for the character, e.g. Hearts for 'H'
fn to_char(&self) -> char
Returns a char that the represents the suit, e.g. 'H' for Hearts
fn to_str(&self) -> &'static str
Returns a string name of the suit
fn suits() -> &'static [Suit]
The standard list of suits
Trait Implementations
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 Hash for Suit
[src]
fn hash<__H: Hasher>(&self, __arg_0: &mut __H)
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. 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 Eq for Suit
[src]
impl PartialOrd for Suit
[src]
fn partial_cmp(&self, __arg_0: &Suit) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &Rhs) -> bool
1.0.0
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, other: &Rhs) -> bool
1.0.0
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, other: &Rhs) -> bool
1.0.0
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, other: &Rhs) -> bool
1.0.0
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more