Struct libcoinche::cards::Card [] [src]

pub struct Card(_);

Represents a single card.

Methods

impl Card
[src]

fn id(self) -> u32

Returns the card number (from 0 to 31)

fn from_id(id: u32) -> Self

Returns the card corresponding to the given number.

Panics

If id >= 32

fn rank(self) -> Rank

Returns the card's rank

fn suit(self) -> Suit

Returns the card's suit.

fn to_string(self) -> String

Returns a string representation of the card.

fn new(suit: Suit, rank: Rank) -> Self

Creates a card from the given suit and rank

Trait Implementations

impl Debug for Card
[src]

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

Formats the value using the given formatter.

impl Copy for Card
[src]

impl Clone for Card
[src]

fn clone(&self) -> Card

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 Card
[src]

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

This method tests for self and other values to be equal, and is used by ==. Read more

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

This method tests for !=.

impl Encodable for Card
[src]

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

impl Decodable for Card
[src]

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