Struct libcoinche::cards::Hand
[−]
[src]
pub struct Hand(_);
Represents an unordered set of cards
Methods
impl Hand
[src]
fn new() -> Self
Returns an empty hand.
fn add(&mut self, card: Card) -> &mut Hand
Add card
to self
.
No effect if self
already contains card
.
fn remove(&mut self, card: Card)
Removes card
from self
.
No effect if self
does not contains card
.
fn clean(&mut self)
Remove all cards from self
.
fn has(self, card: Card) -> bool
Returns true
if self
contains card
.
fn has_any(self, suit: Suit) -> bool
Returns true
if the hand contains any card of the given suit.
fn is_empty(self) -> bool
Returns true
if self
contains no card.
fn get_card(self) -> Card
Returns a card from self
.
Returns an invalid card if self
is empty.
fn list(self) -> Vec<Card>
Returns the cards contained in self
as a Vec
.
fn size(self) -> usize
Returns the number of cards in self
.
Trait Implementations
impl Debug for Hand
[src]
impl Copy for Hand
[src]
impl Clone for Hand
[src]
fn clone(&self) -> Hand
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 Hand
[src]
fn eq(&self, __arg_0: &Hand) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Hand) -> bool
This method tests for !=
.