[][src]Struct lordeckcodes::Deck

pub struct Deck(_);

Holds a set of CardCodeAndCount.

Implementations

impl Deck[src]

pub fn new() -> Self[src]

Create a new empty Deck.

pub fn from_vec(vec: Vec<CardCodeAndCount>) -> Deck[src]

Create a new Deck from a Vec of CardCodeAndCount.

Examples

use lordeckcodes::{CardCodeAndCount, Deck};
let deck = Deck::from_vec(vec![
    CardCodeAndCount::from_data("01SI015", 3).unwrap(),
    CardCodeAndCount::from_data("01SI044", 3).unwrap(),
    CardCodeAndCount::from_data("01SI048", 3).unwrap(),
    CardCodeAndCount::from_data("01SI054", 3).unwrap(),
]);

pub fn add(&mut self, card: CardCodeAndCount)[src]

Add a CardCodeAndCount to the Deck.

pub fn add_from_data(&mut self, code: &str, count: i32) -> Result<(), LorError>[src]

Create and add a new CardCodeAndCount to the deck from the provided data.

pub fn cards(&self) -> &Vec<CardCodeAndCount>[src]

Obtain a reference to the list of CardCodeAndCount.

Trait Implementations

impl Debug for Deck[src]

impl Default for Deck[src]

impl<'de> Deserialize<'de> for Deck[src]

impl<'a> FromIterator<&'a (&'a str, i32)> for Deck[src]

impl PartialEq<Deck> for Deck[src]

impl Serialize for Deck[src]

Auto Trait Implementations

impl RefUnwindSafe for Deck

impl Send for Deck

impl Sync for Deck

impl Unpin for Deck

impl UnwindSafe for Deck

Blanket Implementations

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

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

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

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

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

impl<T, U> Into<U> for T where
    U: From<T>, 
[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.