#[derive(Debug, Clone, Copy, Hash, PartialEq, Eq)]
pub enum LatinExtendedC {
LatinCapitalLetterLWithDoubleBar,
LatinSmallLetterLWithDoubleBar,
LatinCapitalLetterLWithMiddleTilde,
LatinCapitalLetterPWithStroke,
LatinCapitalLetterRWithTail,
LatinSmallLetterAWithStroke,
LatinSmallLetterTWithDiagonalStroke,
LatinCapitalLetterHWithDescender,
LatinSmallLetterHWithDescender,
LatinCapitalLetterKWithDescender,
LatinSmallLetterKWithDescender,
LatinCapitalLetterZWithDescender,
LatinSmallLetterZWithDescender,
LatinCapitalLetterAlpha,
LatinCapitalLetterMWithHook,
LatinCapitalLetterTurnedA,
LatinCapitalLetterTurnedAlpha,
LatinSmallLetterVWithRightHook,
LatinCapitalLetterWWithHook,
LatinSmallLetterWWithHook,
LatinSmallLetterVWithCurl,
LatinCapitalLetterHalfH,
LatinSmallLetterHalfH,
LatinSmallLetterTaillessPhi,
LatinSmallLetterEWithNotch,
LatinSmallLetterTurnedRWithTail,
LatinSmallLetterOWithLowRingInside,
LatinLetterSmallCapitalTurnedE,
LatinSubscriptSmallLetterJ,
ModifierLetterCapitalV,
LatinCapitalLetterSWithSwashTail,
}
impl Into<char> for LatinExtendedC {
fn into(self) -> char {
match self {
LatinExtendedC::LatinCapitalLetterLWithDoubleBar => 'Ⱡ',
LatinExtendedC::LatinSmallLetterLWithDoubleBar => 'ⱡ',
LatinExtendedC::LatinCapitalLetterLWithMiddleTilde => 'Ɫ',
LatinExtendedC::LatinCapitalLetterPWithStroke => 'Ᵽ',
LatinExtendedC::LatinCapitalLetterRWithTail => 'Ɽ',
LatinExtendedC::LatinSmallLetterAWithStroke => 'ⱥ',
LatinExtendedC::LatinSmallLetterTWithDiagonalStroke => 'ⱦ',
LatinExtendedC::LatinCapitalLetterHWithDescender => 'Ⱨ',
LatinExtendedC::LatinSmallLetterHWithDescender => 'ⱨ',
LatinExtendedC::LatinCapitalLetterKWithDescender => 'Ⱪ',
LatinExtendedC::LatinSmallLetterKWithDescender => 'ⱪ',
LatinExtendedC::LatinCapitalLetterZWithDescender => 'Ⱬ',
LatinExtendedC::LatinSmallLetterZWithDescender => 'ⱬ',
LatinExtendedC::LatinCapitalLetterAlpha => 'Ɑ',
LatinExtendedC::LatinCapitalLetterMWithHook => 'Ɱ',
LatinExtendedC::LatinCapitalLetterTurnedA => 'Ɐ',
LatinExtendedC::LatinCapitalLetterTurnedAlpha => 'Ɒ',
LatinExtendedC::LatinSmallLetterVWithRightHook => 'ⱱ',
LatinExtendedC::LatinCapitalLetterWWithHook => 'Ⱳ',
LatinExtendedC::LatinSmallLetterWWithHook => 'ⱳ',
LatinExtendedC::LatinSmallLetterVWithCurl => 'ⱴ',
LatinExtendedC::LatinCapitalLetterHalfH => 'Ⱶ',
LatinExtendedC::LatinSmallLetterHalfH => 'ⱶ',
LatinExtendedC::LatinSmallLetterTaillessPhi => 'ⱷ',
LatinExtendedC::LatinSmallLetterEWithNotch => 'ⱸ',
LatinExtendedC::LatinSmallLetterTurnedRWithTail => 'ⱹ',
LatinExtendedC::LatinSmallLetterOWithLowRingInside => 'ⱺ',
LatinExtendedC::LatinLetterSmallCapitalTurnedE => 'ⱻ',
LatinExtendedC::LatinSubscriptSmallLetterJ => 'ⱼ',
LatinExtendedC::ModifierLetterCapitalV => 'ⱽ',
LatinExtendedC::LatinCapitalLetterSWithSwashTail => 'Ȿ',
}
}
}
impl std::convert::TryFrom<char> for LatinExtendedC {
type Error = ();
fn try_from(c: char) -> Result<Self, Self::Error> {
match c {
'Ⱡ' => Ok(LatinExtendedC::LatinCapitalLetterLWithDoubleBar),
'ⱡ' => Ok(LatinExtendedC::LatinSmallLetterLWithDoubleBar),
'Ɫ' => Ok(LatinExtendedC::LatinCapitalLetterLWithMiddleTilde),
'Ᵽ' => Ok(LatinExtendedC::LatinCapitalLetterPWithStroke),
'Ɽ' => Ok(LatinExtendedC::LatinCapitalLetterRWithTail),
'ⱥ' => Ok(LatinExtendedC::LatinSmallLetterAWithStroke),
'ⱦ' => Ok(LatinExtendedC::LatinSmallLetterTWithDiagonalStroke),
'Ⱨ' => Ok(LatinExtendedC::LatinCapitalLetterHWithDescender),
'ⱨ' => Ok(LatinExtendedC::LatinSmallLetterHWithDescender),
'Ⱪ' => Ok(LatinExtendedC::LatinCapitalLetterKWithDescender),
'ⱪ' => Ok(LatinExtendedC::LatinSmallLetterKWithDescender),
'Ⱬ' => Ok(LatinExtendedC::LatinCapitalLetterZWithDescender),
'ⱬ' => Ok(LatinExtendedC::LatinSmallLetterZWithDescender),
'Ɑ' => Ok(LatinExtendedC::LatinCapitalLetterAlpha),
'Ɱ' => Ok(LatinExtendedC::LatinCapitalLetterMWithHook),
'Ɐ' => Ok(LatinExtendedC::LatinCapitalLetterTurnedA),
'Ɒ' => Ok(LatinExtendedC::LatinCapitalLetterTurnedAlpha),
'ⱱ' => Ok(LatinExtendedC::LatinSmallLetterVWithRightHook),
'Ⱳ' => Ok(LatinExtendedC::LatinCapitalLetterWWithHook),
'ⱳ' => Ok(LatinExtendedC::LatinSmallLetterWWithHook),
'ⱴ' => Ok(LatinExtendedC::LatinSmallLetterVWithCurl),
'Ⱶ' => Ok(LatinExtendedC::LatinCapitalLetterHalfH),
'ⱶ' => Ok(LatinExtendedC::LatinSmallLetterHalfH),
'ⱷ' => Ok(LatinExtendedC::LatinSmallLetterTaillessPhi),
'ⱸ' => Ok(LatinExtendedC::LatinSmallLetterEWithNotch),
'ⱹ' => Ok(LatinExtendedC::LatinSmallLetterTurnedRWithTail),
'ⱺ' => Ok(LatinExtendedC::LatinSmallLetterOWithLowRingInside),
'ⱻ' => Ok(LatinExtendedC::LatinLetterSmallCapitalTurnedE),
'ⱼ' => Ok(LatinExtendedC::LatinSubscriptSmallLetterJ),
'ⱽ' => Ok(LatinExtendedC::ModifierLetterCapitalV),
'Ȿ' => Ok(LatinExtendedC::LatinCapitalLetterSWithSwashTail),
_ => Err(()),
}
}
}
impl Into<u32> for LatinExtendedC {
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 LatinExtendedC {
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 LatinExtendedC {
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 LatinExtendedC {
pub fn new() -> Self {
LatinExtendedC::LatinCapitalLetterLWithDoubleBar
}
pub fn name(&self) -> String {
let s = std::format!("LatinExtendedC{:#?}", self);
string_morph::to_sentence_case(&s)
}
}