Trait walletd_bitcoin::Mnemonic
pub trait Mnemonic {
type Language;
type MnemonicType;
type MnemonicBuilder;
type Mnemonic;
type ErrorType;
// Required methods
fn new(
language: Self::Language,
mnemonic_type: Self::MnemonicType,
passphrase: Option<&str>
) -> Self::Mnemonic;
fn from_phrase(
language: Self::Language,
phrase: &str,
specified_passphrase: Option<&str>
) -> Result<Self::Mnemonic, Self::ErrorType>;
fn detect_language(
phrase: &str,
specified_passphrase: Option<&str>
) -> Result<Self::Mnemonic, Self::ErrorType>;
fn builder() -> Self::MnemonicBuilder;
fn to_seed(&self) -> Seed;
fn language(&self) -> Self::Language;
fn phrase(&self) -> String;
fn mnemonic_type(&self) -> Self::MnemonicType;
}
Expand description
Provide a common interface for different mnemonic protocols.
Required Associated Types§
type Language
type Language
The associated Language struct
type MnemonicType
type MnemonicType
The associated MnemonicType struct
type MnemonicBuilder
type MnemonicBuilder
The associated Builder struct for the Mnemonic
type Mnemonic
type ErrorType
Required Methods§
fn new(
language: Self::Language,
mnemonic_type: Self::MnemonicType,
passphrase: Option<&str>
) -> Self::Mnemonic
fn new( language: Self::Language, mnemonic_type: Self::MnemonicType, passphrase: Option<&str> ) -> Self::Mnemonic
Generates a new mnemonic given the language, mnemonic type, and an optional passphrase.
fn from_phrase(
language: Self::Language,
phrase: &str,
specified_passphrase: Option<&str>
) -> Result<Self::Mnemonic, Self::ErrorType>
fn from_phrase( language: Self::Language, phrase: &str, specified_passphrase: Option<&str> ) -> Result<Self::Mnemonic, Self::ErrorType>
Recovers a mnemonic given the given the language, mnemonic type, and an optional passphrase.