Skip to main content

Deck

Enum Deck 

Source
pub enum Deck<const CARDS: u8> {}
Expand description

Origin marker for card-deck entropy. CARDS is the deck size; the entropy a full shuffle delivers is log₂(CARDS!) bits.

  • Deck<32> — Skat. ~118 bits, too small for BIP39.
  • Deck<40> — Spanish baraja, stripped. ~159 bits, 12-word only.
  • Deck<48> — Pinochle / Spanish baraja (full). ~202 bits, 12-word only.
  • Deck<52> — standard poker / playing cards. ~226 bits, 12-word only; never use for 24-word mnemonics.
  • Deck<58> — smallest deck that clears 256 bits (~260). First size that supports 24-word mnemonics.
  • Deck<78> — Tarot. ~380 bits, 12- or 24-word.
  • Deck<108> — UNO (pre-2018). ~575 bits, 12- or 24-word.
  • Deck<112> — UNO (2018+). ~599 bits, 12- or 24-word.

Greater the deck, fewer the draws, but the harder the UX.

Auto Trait Implementations§

§

impl<const CARDS: u8> Freeze for Deck<CARDS>

§

impl<const CARDS: u8> RefUnwindSafe for Deck<CARDS>

§

impl<const CARDS: u8> Send for Deck<CARDS>

§

impl<const CARDS: u8> Sync for Deck<CARDS>

§

impl<const CARDS: u8> Unpin for Deck<CARDS>

§

impl<const CARDS: u8> UnsafeUnpin for Deck<CARDS>

§

impl<const CARDS: u8> UnwindSafe for Deck<CARDS>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.