Trait cryptraits::key::WithPhrase
source · 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§
sourcefn generate_with_phrase(
word_count: usize,
password: Option<&str>
) -> Result<(Self, String), Self::E>where
Self: Sized,
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.