Struct simple_cards::deck::Deck

source ·
pub struct Deck { /* private fields */ }

Implementations

Creates a new, ordered deck of 52 cards. Use Deck::default() to get one pre-shuffled.

Creates a new, empty deck.

Clears the deck of all cards.

Returns the amount of cards in the deck.

Returns whether or not the deck is empty.

Returns reference to a card given an index.

Adds a card to the bottom of the deck.

Adds a card to the front of the deck.

Adds a deck of cards, one by one, to the bottom of this deck.

Draws one card from the front of the deck, returning an Option.

Draws one card from the bottom of the deck, return an Option.

Shuffles the deck.

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.