#[derive(Debug, Clone, Copy, Hash, PartialEq, Eq)]
pub enum GunjalaGondi {
LetterA,
LetterAa,
LetterI,
LetterIi,
LetterU,
LetterUu,
LetterEe,
LetterAi,
LetterOo,
LetterAu,
LetterYa,
LetterVa,
LetterBa,
LetterBha,
LetterMa,
LetterKa,
LetterKha,
LetterTa,
LetterTha,
LetterLa,
LetterGa,
LetterGha,
LetterDa,
LetterDha,
LetterNa,
LetterCa,
LetterCha,
LetterTta,
LetterTtha,
LetterLla,
LetterJa,
LetterJha,
LetterDda,
LetterDdha,
LetterNga,
LetterPa,
LetterPha,
LetterHa,
LetterRa,
LetterSa,
VowelSignAa,
VowelSignI,
VowelSignIi,
VowelSignU,
VowelSignUu,
VowelSignEe,
VowelSignAi,
VowelSignOo,
VowelSignAu,
SignAnusvara,
SignVisarga,
Virama,
Om,
DigitZero,
DigitOne,
DigitTwo,
DigitThree,
DigitFour,
DigitFive,
DigitSix,
DigitSeven,
DigitEight,
DigitNine,
}
impl Into<char> for GunjalaGondi {
fn into(self) -> char {
match self {
GunjalaGondi::LetterA => '𑵠',
GunjalaGondi::LetterAa => '𑵡',
GunjalaGondi::LetterI => '𑵢',
GunjalaGondi::LetterIi => '𑵣',
GunjalaGondi::LetterU => '𑵤',
GunjalaGondi::LetterUu => '𑵥',
GunjalaGondi::LetterEe => '𑵧',
GunjalaGondi::LetterAi => '𑵨',
GunjalaGondi::LetterOo => '𑵪',
GunjalaGondi::LetterAu => '𑵫',
GunjalaGondi::LetterYa => '𑵬',
GunjalaGondi::LetterVa => '𑵭',
GunjalaGondi::LetterBa => '𑵮',
GunjalaGondi::LetterBha => '𑵯',
GunjalaGondi::LetterMa => '𑵰',
GunjalaGondi::LetterKa => '𑵱',
GunjalaGondi::LetterKha => '𑵲',
GunjalaGondi::LetterTa => '𑵳',
GunjalaGondi::LetterTha => '𑵴',
GunjalaGondi::LetterLa => '𑵵',
GunjalaGondi::LetterGa => '𑵶',
GunjalaGondi::LetterGha => '𑵷',
GunjalaGondi::LetterDa => '𑵸',
GunjalaGondi::LetterDha => '𑵹',
GunjalaGondi::LetterNa => '𑵺',
GunjalaGondi::LetterCa => '𑵻',
GunjalaGondi::LetterCha => '𑵼',
GunjalaGondi::LetterTta => '𑵽',
GunjalaGondi::LetterTtha => '𑵾',
GunjalaGondi::LetterLla => '𑵿',
GunjalaGondi::LetterJa => '𑶀',
GunjalaGondi::LetterJha => '𑶁',
GunjalaGondi::LetterDda => '𑶂',
GunjalaGondi::LetterDdha => '𑶃',
GunjalaGondi::LetterNga => '𑶄',
GunjalaGondi::LetterPa => '𑶅',
GunjalaGondi::LetterPha => '𑶆',
GunjalaGondi::LetterHa => '𑶇',
GunjalaGondi::LetterRa => '𑶈',
GunjalaGondi::LetterSa => '𑶉',
GunjalaGondi::VowelSignAa => '𑶊',
GunjalaGondi::VowelSignI => '𑶋',
GunjalaGondi::VowelSignIi => '𑶌',
GunjalaGondi::VowelSignU => '𑶍',
GunjalaGondi::VowelSignUu => '𑶎',
GunjalaGondi::VowelSignEe => '𑶐',
GunjalaGondi::VowelSignAi => '𑶑',
GunjalaGondi::VowelSignOo => '𑶓',
GunjalaGondi::VowelSignAu => '𑶔',
GunjalaGondi::SignAnusvara => '𑶕',
GunjalaGondi::SignVisarga => '𑶖',
GunjalaGondi::Virama => '𑶗',
GunjalaGondi::Om => '𑶘',
GunjalaGondi::DigitZero => '𑶠',
GunjalaGondi::DigitOne => '𑶡',
GunjalaGondi::DigitTwo => '𑶢',
GunjalaGondi::DigitThree => '𑶣',
GunjalaGondi::DigitFour => '𑶤',
GunjalaGondi::DigitFive => '𑶥',
GunjalaGondi::DigitSix => '𑶦',
GunjalaGondi::DigitSeven => '𑶧',
GunjalaGondi::DigitEight => '𑶨',
GunjalaGondi::DigitNine => '𑶩',
}
}
}
impl std::convert::TryFrom<char> for GunjalaGondi {
type Error = ();
fn try_from(c: char) -> Result<Self, Self::Error> {
match c {
'𑵠' => Ok(GunjalaGondi::LetterA),
'𑵡' => Ok(GunjalaGondi::LetterAa),
'𑵢' => Ok(GunjalaGondi::LetterI),
'𑵣' => Ok(GunjalaGondi::LetterIi),
'𑵤' => Ok(GunjalaGondi::LetterU),
'𑵥' => Ok(GunjalaGondi::LetterUu),
'𑵧' => Ok(GunjalaGondi::LetterEe),
'𑵨' => Ok(GunjalaGondi::LetterAi),
'𑵪' => Ok(GunjalaGondi::LetterOo),
'𑵫' => Ok(GunjalaGondi::LetterAu),
'𑵬' => Ok(GunjalaGondi::LetterYa),
'𑵭' => Ok(GunjalaGondi::LetterVa),
'𑵮' => Ok(GunjalaGondi::LetterBa),
'𑵯' => Ok(GunjalaGondi::LetterBha),
'𑵰' => Ok(GunjalaGondi::LetterMa),
'𑵱' => Ok(GunjalaGondi::LetterKa),
'𑵲' => Ok(GunjalaGondi::LetterKha),
'𑵳' => Ok(GunjalaGondi::LetterTa),
'𑵴' => Ok(GunjalaGondi::LetterTha),
'𑵵' => Ok(GunjalaGondi::LetterLa),
'𑵶' => Ok(GunjalaGondi::LetterGa),
'𑵷' => Ok(GunjalaGondi::LetterGha),
'𑵸' => Ok(GunjalaGondi::LetterDa),
'𑵹' => Ok(GunjalaGondi::LetterDha),
'𑵺' => Ok(GunjalaGondi::LetterNa),
'𑵻' => Ok(GunjalaGondi::LetterCa),
'𑵼' => Ok(GunjalaGondi::LetterCha),
'𑵽' => Ok(GunjalaGondi::LetterTta),
'𑵾' => Ok(GunjalaGondi::LetterTtha),
'𑵿' => Ok(GunjalaGondi::LetterLla),
'𑶀' => Ok(GunjalaGondi::LetterJa),
'𑶁' => Ok(GunjalaGondi::LetterJha),
'𑶂' => Ok(GunjalaGondi::LetterDda),
'𑶃' => Ok(GunjalaGondi::LetterDdha),
'𑶄' => Ok(GunjalaGondi::LetterNga),
'𑶅' => Ok(GunjalaGondi::LetterPa),
'𑶆' => Ok(GunjalaGondi::LetterPha),
'𑶇' => Ok(GunjalaGondi::LetterHa),
'𑶈' => Ok(GunjalaGondi::LetterRa),
'𑶉' => Ok(GunjalaGondi::LetterSa),
'𑶊' => Ok(GunjalaGondi::VowelSignAa),
'𑶋' => Ok(GunjalaGondi::VowelSignI),
'𑶌' => Ok(GunjalaGondi::VowelSignIi),
'𑶍' => Ok(GunjalaGondi::VowelSignU),
'𑶎' => Ok(GunjalaGondi::VowelSignUu),
'𑶐' => Ok(GunjalaGondi::VowelSignEe),
'𑶑' => Ok(GunjalaGondi::VowelSignAi),
'𑶓' => Ok(GunjalaGondi::VowelSignOo),
'𑶔' => Ok(GunjalaGondi::VowelSignAu),
'𑶕' => Ok(GunjalaGondi::SignAnusvara),
'𑶖' => Ok(GunjalaGondi::SignVisarga),
'𑶗' => Ok(GunjalaGondi::Virama),
'𑶘' => Ok(GunjalaGondi::Om),
'𑶠' => Ok(GunjalaGondi::DigitZero),
'𑶡' => Ok(GunjalaGondi::DigitOne),
'𑶢' => Ok(GunjalaGondi::DigitTwo),
'𑶣' => Ok(GunjalaGondi::DigitThree),
'𑶤' => Ok(GunjalaGondi::DigitFour),
'𑶥' => Ok(GunjalaGondi::DigitFive),
'𑶦' => Ok(GunjalaGondi::DigitSix),
'𑶧' => Ok(GunjalaGondi::DigitSeven),
'𑶨' => Ok(GunjalaGondi::DigitEight),
'𑶩' => Ok(GunjalaGondi::DigitNine),
_ => Err(()),
}
}
}
impl Into<u32> for GunjalaGondi {
fn into(self) -> u32 {
let c: char = self.into();
let hex = c
.escape_unicode()
.to_string()
.replace("\\u{", "")
.replace("}", "");
u32::from_str_radix(&hex, 16).unwrap()
}
}
impl std::convert::TryFrom<u32> for GunjalaGondi {
type Error = ();
fn try_from(u: u32) -> Result<Self, Self::Error> {
if let Ok(c) = char::try_from(u) {
Self::try_from(c)
} else {
Err(())
}
}
}
impl Iterator for GunjalaGondi {
type Item = Self;
fn next(&mut self) -> Option<Self> {
let index: u32 = (*self).into();
use std::convert::TryFrom;
Self::try_from(index + 1).ok()
}
}
impl GunjalaGondi {
pub fn new() -> Self {
GunjalaGondi::LetterA
}
pub fn name(&self) -> String {
let s = std::format!("GunjalaGondi{:#?}", self);
string_morph::to_sentence_case(&s)
}
}