Skip to main content

SensitiveGame

Trait SensitiveGame 

Source
pub trait SensitiveGame: Sized {
    // Required method
    fn to_entropy<const N: usize>(
        input: &[u8],
    ) -> Result<SensitiveBytes<N, Self>, EntropyError>;

    // Provided methods
    fn mnemonic<const W: u8>(
        input: &[u8],
    ) -> Result<GameMnemonic<Self, W>, MnemonicError> { ... }
    fn build<const W: u8, const N: usize>(
        input: &[u8],
    ) -> Result<GameMnemonic<Self, W>, MnemonicError> { ... }
}
Expand description

Contract for any entropy-source (“game”) that can produce a BIP39 mnemonic. Implementers supply only [to_entropy]. Per-W.

Required Methods§

Source

fn to_entropy<const N: usize>( input: &[u8], ) -> Result<SensitiveBytes<N, Self>, EntropyError>

Game-specific entropy function: raw input bytes → N-byte origin-tagged SensitiveBytes.

Provided Methods§

Source

fn mnemonic<const W: u8>( input: &[u8], ) -> Result<GameMnemonic<Self, W>, MnemonicError>

Feature-gated per-W, then build the mnemonic. Each game shares this code path; only the byte size per W differs.

Source

fn build<const W: u8, const N: usize>( input: &[u8], ) -> Result<GameMnemonic<Self, W>, MnemonicError>

Entropy with explicit N to GameMnemonic<Self, W>.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<const FACES: u8> SensitiveGame for Dice<FACES>

Source§

fn to_entropy<const N: usize>( input: &[u8], ) -> Result<SensitiveBytes<N, Self>, EntropyError>

Implementors§