[−][src]Struct cardpack::Pack
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]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
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]
T: 'static + ?Sized,
impl<T> AnyEq for T where
T: PartialEq<T> + Any,
T: PartialEq<T> + Any,
pub fn equals(&self, other: &(dyn Any + 'static)) -> bool
pub fn as_any(&self) -> &(dyn Any + 'static)
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,