[][src]Struct cardpack::Card

pub struct Card {
    pub weight: isize,
    pub index: String,
    pub suit: Suit,
    pub rank: Rank,
}

Card is the core struct in the library. A Card is made up of a Rank, a Suit and weight, which is an integer that controls how a card is sorted in a Pile or as a part of a Vector.

Fields

weight: isize

Used by the Pile struct to sort Cards.

index: String

The identity indicator in the corner of a playing card, such as AS for ace of spades.

suit: Suitrank: Rank

Implementations

impl Card[src]

pub fn new(rank: &'static str, suit: &'static str) -> Card[src]

Instantiates a new Card with the default weight as defined in the fluent templates.

pub fn new_from_structs(rank: Rank, suit: Suit) -> Card[src]

Instantiates a Card with the weight determined by the passed in Rank and Suit.

pub fn symbol(&self, lid: &LanguageIdentifier) -> String[src]

Returns a Symbol String for the Card.

pub fn symbol_colorized(&self, lid: &LanguageIdentifier) -> String[src]

Returns a Symbol String for the Card in the traditional colors for the Suits.

Trait Implementations

impl Clone for Card[src]

impl Debug for Card[src]

impl Default for Card[src]

impl Display for Card[src]

impl Eq for Card[src]

impl FromIterator<Card> for Pile[src]

impl Hash for Card[src]

impl Named for Card[src]

impl Ord for Card[src]

impl PartialEq<Card> for Card[src]

impl PartialOrd<Card> for Card[src]

impl StructuralEq for Card[src]

impl StructuralPartialEq for Card[src]

Auto Trait Implementations

impl RefUnwindSafe for Card

impl Send for Card

impl Sync for Card

impl Unpin for Card

impl UnwindSafe for Card

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> AnyEq for T where
    T: PartialEq<T> + Any

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,