calendar_core/
auspiciousness.rs1use alloc::string::String;
7
8#[non_exhaustive]
13#[derive(Debug, Clone, PartialEq, Eq, Hash)]
14pub enum Activity {
15 Marriage,
17 Building,
19 Travel,
21 Business,
23 Agriculture,
25 ReligiousCeremony,
27 Naming,
29 MovingHouse,
31 Education,
33 Medical,
35 Custom(String),
37}
38
39impl Activity {
40 #[must_use]
42 pub fn description(&self) -> &str {
43 match self {
44 Self::Marriage => "Marriage ceremonies and weddings",
45 Self::Building => "Building construction and foundation laying",
46 Self::Travel => "Travel and journeys",
47 Self::Business => "Business ventures and commerce",
48 Self::Agriculture => "Agricultural activities and planting",
49 Self::ReligiousCeremony => "Religious ceremonies and rituals",
50 Self::Naming => "Naming ceremonies for children",
51 Self::MovingHouse => "Moving to a new house or residence",
52 Self::Education => "Starting education or learning",
53 Self::Medical => "Medical treatments and procedures",
54 Self::Custom(desc) => desc,
55 }
56 }
57}
58
59#[non_exhaustive]
64#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
65pub enum AuspiciousnessLevel {
66 VeryAuspicious,
68 Auspicious,
70 Neutral,
72 Inauspicious,
74 VeryInauspicious,
76}
77
78impl AuspiciousnessLevel {
79 #[must_use]
81 pub const fn description(&self) -> &'static str {
82 match self {
83 Self::VeryAuspicious => "Very auspicious - extremely favorable",
84 Self::Auspicious => "Auspicious - favorable",
85 Self::Neutral => "Neutral - neither favorable nor unfavorable",
86 Self::Inauspicious => "Inauspicious - unfavorable",
87 Self::VeryInauspicious => "Very inauspicious - very unfavorable",
88 }
89 }
90
91 #[must_use]
93 pub const fn is_auspicious(self) -> bool {
94 matches!(self, Self::Auspicious | Self::VeryAuspicious)
95 }
96
97 #[must_use]
99 pub const fn is_very_auspicious(self) -> bool {
100 matches!(self, Self::VeryAuspicious)
101 }
102
103 #[must_use]
105 pub const fn is_inauspicious(self) -> bool {
106 matches!(self, Self::Inauspicious | Self::VeryInauspicious)
107 }
108
109 #[must_use]
111 pub const fn is_very_inauspicious(self) -> bool {
112 matches!(self, Self::VeryInauspicious)
113 }
114
115 #[must_use]
117 pub const fn is_neutral(self) -> bool {
118 matches!(self, Self::Neutral)
119 }
120}
121
122impl core::fmt::Display for Activity {
123 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
124 write!(f, "{}", self.description())
125 }
126}
127
128impl core::fmt::Display for AuspiciousnessLevel {
129 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
130 write!(f, "{}", self.description())
131 }
132}