[][src]Trait deckofcards::Cards

pub trait Cards {
    fn cards(&self) -> &[Card];
fn mut_cards(&mut self) -> &mut [Card]; fn shuffle(&mut self) { ... }
fn sort_suit_ascending_rank(&mut self) { ... }
fn sort_suit_descending_rank(&mut self) { ... }
fn sort_descending_rank_suit(&mut self) { ... } }

Certain actions are common to a deck and a hand of cards

Required methods

fn cards(&self) -> &[Card]

Return the cards as a slice

fn mut_cards(&mut self) -> &mut [Card]

Return the cards as a mutable slice

Loading content...

Provided methods

fn shuffle(&mut self)

Shuffle the cards into a random order

fn sort_suit_ascending_rank(&mut self)

Sort the cards by suit and then by rank (low to high)

fn sort_suit_descending_rank(&mut self)

Sorts the cards by suit and then by rank (high to low)

fn sort_descending_rank_suit(&mut self)

Sort the cards by rank (high to low) and then by suit

Loading content...

Implementors

impl Cards for Deck[src]

impl Cards for Hand[src]

Loading content...