Struct libcoinche::cards::Hand [] [src]

pub struct Hand(_);

Represents an unordered set of cards.

Methods

impl Hand

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 Encodable for Hand

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

impl Decodable for Hand

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

impl ToString for Hand

fn to_string(&self) -> String

Derived Implementations

impl Debug for Hand

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

impl Copy for Hand

impl Clone for Hand

fn clone(&self) -> Hand

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

impl PartialEq for Hand

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

fn ne(&self, __arg_0: &Hand) -> bool