Struct simple_cards::deck::Deck
source · pub struct Deck { /* private fields */ }
Implementations
sourceimpl Deck
impl Deck
sourcepub fn new() -> Deck
pub fn new() -> Deck
Creates a new, ordered deck of 52 cards.
Use Deck::default()
to get one pre-shuffled.
sourcepub fn add_bottom(&mut self, card: Card)
pub fn add_bottom(&mut self, card: Card)
Adds a card to the front of the deck.
sourcepub fn add_deck(&mut self, deck: &mut Deck)
pub fn add_deck(&mut self, deck: &mut Deck)
Adds a deck of cards, one by one, to the bottom of this deck.
sourcepub fn draw(&mut self) -> Option<Card>
pub fn draw(&mut self) -> Option<Card>
Draws one card from the front of the deck, returning an Option
sourcepub fn draw_bottom(&mut self) -> Option<Card>
pub fn draw_bottom(&mut self) -> Option<Card>
Draws one card from the bottom of the deck, return an Option
Trait Implementations
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
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more