pub struct DeckBuilder<C> { /* private fields */ }Expand description
A builder for a deck of cards. use “done” to finish.
Implementations§
Source§impl<C> DeckBuilder<C>
impl<C> DeckBuilder<C>
pub fn new() -> Self
Sourcepub fn draw_pile(self, v: Vec<C>) -> Self
pub fn draw_pile(self, v: Vec<C>) -> Self
Fill the Draw Pile with the supplied vector, consuming it
Sourcepub fn discard_pile(self, v: Vec<C>) -> Self
pub fn discard_pile(self, v: Vec<C>) -> Self
fill the Discard pile with the supplied vector consuming it
Sourcepub fn pre_shuffle(self, b: bool) -> Self
pub fn pre_shuffle(self, b: bool) -> Self
Shuffle all cards, at constrution? default: true
Sourcepub fn shuffle_discards(self, b: bool) -> Self
pub fn shuffle_discards(self, b: bool) -> Self
Shuffle discards before adding to the bottom of the draw_pile? default: true
Sourcepub fn stop_on_discards(self, b: bool) -> Self
pub fn stop_on_discards(self, b: bool) -> Self
If true, the deck is considered ending at the bottom of the draw pile. This is for all iterators and len Default: false
pub fn done(self) -> Deck<C>
Auto Trait Implementations§
impl<C> Freeze for DeckBuilder<C>
impl<C> RefUnwindSafe for DeckBuilder<C>where
C: RefUnwindSafe,
impl<C> Send for DeckBuilder<C>where
C: Send,
impl<C> Sync for DeckBuilder<C>where
C: Sync,
impl<C> Unpin for DeckBuilder<C>where
C: Unpin,
impl<C> UnwindSafe for DeckBuilder<C>where
C: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more