[][src]Struct cardpack::Pack

pub struct Pack { /* fields omitted */ }

A Pack is an immutable pile of cards. Packs are designed to be a flexible representation of a deck, stack, discard pile, or hand.

Packs available are for a traditional 52 card French Deck, pinochle, spades, skat and tarot.

Usage:

let pack = cardpack::Pack::french_deck();

let mut shuffled = pack.cards().shuffle();
let sb = shuffled.draw(2).unwrap();
let bb = shuffled.draw(2).unwrap();

println!("small blind: {}", sb.by_symbol_index());
println!("big blind:   {}", bb);

println!();
println!("flop : {}", shuffled.draw(3).unwrap());
println!("turn : {}", shuffled.draw(1).unwrap());
println!("river: {}", shuffled.draw(1).unwrap());

Implementations

impl Pack[src]

pub fn is_complete(&self, piles: &[Pile]) -> bool[src]

Returns true of the combined Cards from the passed in Vector match the Cards in the Pack.

pub fn cards(&self) -> &Pile[src]

Returns a reference to the cards in the Pack.

pub fn canasta_deck() -> Pack[src]

pub fn euchre_deck() -> Pack[src]

pub fn hand_and_foot_deck() -> Pack[src]

pub fn french_deck() -> Pack[src]

pub fn french_deck_with_jokers() -> Pack[src]

pub fn pinochle_deck() -> Pack[src]

pub fn skat_deck() -> Pack[src]

pub fn spades_deck() -> Pack[src]

Trait Implementations

impl Clone for Pack[src]

impl Debug for Pack[src]

impl Hash for Pack[src]

impl PartialEq<Pack> for Pack[src]

impl StructuralPartialEq for Pack[src]

Auto Trait Implementations

impl RefUnwindSafe for Pack

impl Send for Pack

impl Sync for Pack

impl Unpin for Pack

impl UnwindSafe for Pack

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, 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>,