[−][src]Struct lordeckcodes::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]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>, [src]
__D: Deserializer<'de>,
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>, [src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
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.
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>,