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§
Sourcefn to_entropy<const N: usize>(
input: &[u8],
) -> Result<SensitiveBytes<N, Self>, EntropyError>
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§
Sourcefn mnemonic<const W: u8>(
input: &[u8],
) -> Result<GameMnemonic<Self, W>, MnemonicError>
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.
Sourcefn build<const W: u8, const N: usize>(
input: &[u8],
) -> Result<GameMnemonic<Self, W>, MnemonicError>
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.