pub enum Language {
English,
Japanese,
Spanish,
ChineseSimplified,
Korean,
}Expand description
Supported languages for mnemonic generation.
BIP39 defines wordlists for multiple languages. Each wordlist contains exactly 2048 words that are used to encode entropy into a mnemonic phrase.
§Example
use rustywallet_mnemonic::Language;
let lang = Language::English;
assert!(lang.contains("abandon"));
let lang = Language::Japanese;
assert!(lang.contains("あいこくしん"));Variants§
English
English wordlist (BIP39 standard)
Japanese
Japanese wordlist (BIP39)
Spanish
Spanish wordlist (BIP39)
ChineseSimplified
Chinese Simplified wordlist (BIP39)
Korean
Korean wordlist (BIP39)
Implementations§
Source§impl Language
impl Language
Sourcepub fn detect_from_word(word: &str) -> Option<Language>
pub fn detect_from_word(word: &str) -> Option<Language>
Detect language from a single word.
Returns the first language that contains the word. Note: Some words may exist in multiple wordlists.
Sourcepub fn detect_from_phrase(phrase: &str) -> Option<Language>
pub fn detect_from_phrase(phrase: &str) -> Option<Language>
Detect language from a phrase by checking all words.
Returns the language where all words are found in the wordlist. Returns None if no single language contains all words.
Trait Implementations§
impl Copy for Language
impl Eq for Language
impl StructuralPartialEq for Language
Auto Trait Implementations§
impl Freeze for Language
impl RefUnwindSafe for Language
impl Send for Language
impl Sync for Language
impl Unpin for Language
impl UnwindSafe for Language
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more