You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

types.rs 2.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. #[derive(Debug, Copy, Clone, PartialEq)]
  2. pub enum LineBreakClass {
  3. BK,
  4. CM,
  5. CR,
  6. GL,
  7. LF,
  8. NL,
  9. SP,
  10. WJ,
  11. ZW,
  12. ZWJ,
  13. AI,
  14. AL,
  15. B2,
  16. BA,
  17. BB,
  18. CB,
  19. CJ,
  20. CL,
  21. CP,
  22. EB,
  23. EM,
  24. EX,
  25. H2,
  26. H3,
  27. HL,
  28. HY,
  29. ID,
  30. IN,
  31. IS,
  32. JL,
  33. JT,
  34. JV,
  35. NS,
  36. NU,
  37. OP,
  38. PO,
  39. PR,
  40. QU,
  41. RI,
  42. SA,
  43. SG,
  44. SY,
  45. XX,
  46. }
  47. use LineBreakClass::*;
  48. impl From<&str> for LineBreakClass {
  49. fn from(val: &str) -> Self {
  50. match val {
  51. stringify!(BK) => BK,
  52. stringify!(CM) => CM,
  53. stringify!(CR) => CR,
  54. stringify!(GL) => GL,
  55. stringify!(LF) => LF,
  56. stringify!(NL) => NL,
  57. stringify!(SP) => SP,
  58. stringify!(WJ) => WJ,
  59. stringify!(ZW) => ZW,
  60. stringify!(ZWJ) => ZWJ,
  61. stringify!(AI) => AI,
  62. stringify!(AL) => AL,
  63. stringify!(B2) => B2,
  64. stringify!(BA) => BA,
  65. stringify!(BB) => BB,
  66. stringify!(CB) => CB,
  67. stringify!(CJ) => CJ,
  68. stringify!(CL) => CL,
  69. stringify!(CP) => CP,
  70. stringify!(EB) => EB,
  71. stringify!(EM) => EM,
  72. stringify!(EX) => EX,
  73. stringify!(H2) => H2,
  74. stringify!(H3) => H3,
  75. stringify!(HL) => HL,
  76. stringify!(HY) => HY,
  77. stringify!(ID) => ID,
  78. stringify!(IN) => IN,
  79. stringify!(IS) => IS,
  80. stringify!(JL) => JL,
  81. stringify!(JT) => JT,
  82. stringify!(JV) => JV,
  83. stringify!(NS) => NS,
  84. stringify!(NU) => NU,
  85. stringify!(OP) => OP,
  86. stringify!(PO) => PO,
  87. stringify!(PR) => PR,
  88. stringify!(QU) => QU,
  89. stringify!(RI) => RI,
  90. stringify!(SA) => SA,
  91. stringify!(SG) => SG,
  92. stringify!(SY) => SY,
  93. stringify!(XX) => XX,
  94. _ => unreachable!(),
  95. }
  96. }
  97. }