Skip to main content

GameMnemonic

Struct GameMnemonic 

Source
pub struct GameMnemonic<O, const W: u8> { /* private fields */ }
Expand description

Sensitive BIP39 mnemonic wrapper. O is a zero-sized origin marker (e.g. kdk_entropy::Coin, kdk_entropy::Dice<F>, kdk_entropy::Deck<C>) and W is the word count (12 / 15 / 18 / 21 / 24).

Implementations§

Source§

impl<O, const W: u8> GameMnemonic<O, W>

Source

pub const fn word_count(&self) -> usize

Word count of this mnemonic — returned from the const generic W without touching the inner secret. Use this instead of expose_secret().word_count() whenever you just need the metadata.

Trait Implementations§

Source§

impl<O, const W: u8> Debug for GameMnemonic<O, W>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<O, const W: u8> Display for GameMnemonic<O, W>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<O, const W: u8> Sensitive for GameMnemonic<O, W>

Source§

type Inner = Mnemonic

The type whose bytes are the secret material.
Source§

fn expose_secret(&self) -> &Mnemonic

Explicit-secret-access getter. Mirrors the inherent expose_secret every sensitive type provides.

Auto Trait Implementations§

§

impl<O, const W: u8> Freeze for GameMnemonic<O, W>

§

impl<O, const W: u8> RefUnwindSafe for GameMnemonic<O, W>
where O: RefUnwindSafe,

§

impl<O, const W: u8> Send for GameMnemonic<O, W>
where O: Send,

§

impl<O, const W: u8> Sync for GameMnemonic<O, W>
where O: Sync,

§

impl<O, const W: u8> Unpin for GameMnemonic<O, W>
where O: Unpin,

§

impl<O, const W: u8> UnsafeUnpin for GameMnemonic<O, W>

§

impl<O, const W: u8> UnwindSafe for GameMnemonic<O, W>
where O: UnwindSafe,

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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
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.