1pub type LettersType = (char, Forms);
3
4#[derive(Clone, Copy, PartialEq, Eq)]
6#[repr(usize)]
7pub(crate) enum LetterForm {
8 Isolated,
9 Initial,
10 Medial,
11 Final,
12 Unsupported,
13 Unshaped,
14}
15
16#[derive(Clone, Copy, Debug, PartialEq, Eq)]
18#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
19pub struct Forms {
20 pub isolated: char,
21 pub initial: char,
22 pub medial: char,
23 pub end: char,
24}
25
26impl Forms {
27 pub const fn new(isolated: char, initial: char, medial: char, end: char) -> Self {
28 Self {
29 isolated,
30 initial,
31 medial,
32 end,
33 }
34 }
35
36 pub(crate) const fn get(&self, form: LetterForm) -> char {
37 match form {
38 LetterForm::Isolated => self.isolated,
39 LetterForm::Initial => self.initial,
40 LetterForm::Medial => self.medial,
41 LetterForm::Final => self.end,
42 _ => panic!("Unsupported Letter form"),
43 }
44 }
45}