Trait nv_card::Deck
[−]
[src]
pub trait Deck { type Card; fn size(&self) -> usize; fn shuffle(&mut self); fn add_card_to_bottom(&mut self, card: Self::Card); fn add_card_to_top(&mut self, card: Self::Card); fn remove_card_from_bottom(&mut self) -> Option<Self::Card>; fn remove_card_from_top(&mut self) -> Option<Self::Card>; fn iter(&mut self) -> DeckIterator<Self::Card, Self>
where
Self: Sized; }
The trait that is supported by all decks. It is implemented for types that are mutable collections and can be represented as an array
Associated Types
type Card
Required Methods
fn size(&self) -> usize
fn shuffle(&mut self)
fn add_card_to_bottom(&mut self, card: Self::Card)
fn add_card_to_top(&mut self, card: Self::Card)
fn remove_card_from_bottom(&mut self) -> Option<Self::Card>
fn remove_card_from_top(&mut self) -> Option<Self::Card>
fn iter(&mut self) -> DeckIterator<Self::Card, Self> where
Self: Sized,
Self: Sized,
Implementors
impl<T, I> Deck for T where
T: MutableCollection<Item = I> + Sliceable<Item = I>,