pub trait WithPhrase {
    type E: Error;

    // Required methods
    fn generate_with_phrase(
        word_count: usize,
        password: Option<&str>
    ) -> Result<(Self, String), Self::E>
       where Self: Sized;
    fn from_phrase<'a, S: Into<Cow<'a, str>>>(
        s: S,
        password: Option<&str>
    ) -> Result<Self, Self::E>
       where Self: Sized;
    fn generate_in_with<R>(
        rng: &mut R,
        word_count: usize,
        password: Option<&str>
    ) -> Result<(Self, String), Self::E>
       where Self: Sized,
             R: RngCore + CryptoRng;
}
Expand description

Generate and construct a value with mnemonic phrase and optional password.

Required Associated Types§

Required Methods§

source

fn generate_with_phrase( word_count: usize, password: Option<&str> ) -> Result<(Self, String), Self::E>
where Self: Sized,

Generate a new value of word_count words and optional password.

Returns tuple of generated value and a phrase or error.

source

fn from_phrase<'a, S: Into<Cow<'a, str>>>( s: S, password: Option<&str> ) -> Result<Self, Self::E>
where Self: Sized,

Construct a value from mnemonic phrase and optional password.

source

fn generate_in_with<R>( rng: &mut R, word_count: usize, password: Option<&str> ) -> Result<(Self, String), Self::E>
where Self: Sized, R: RngCore + CryptoRng,

Generate a new value of word_count words and optional password witn rng PRF.

Returns tuple of generated value and a phrase or error.

Implementors§