1use serde::{Deserialize, Serialize};
4
5#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
8#[serde(rename_all = "lowercase")]
9pub enum Kind {
10 Entity,
12 Concept,
14 Synthesis,
16}
17
18impl Kind {
19 #[must_use]
21 pub fn as_str(self) -> &'static str {
22 match self {
23 Self::Entity => "entity",
24 Self::Concept => "concept",
25 Self::Synthesis => "synthesis",
26 }
27 }
28
29 #[must_use]
31 pub fn defaults() -> &'static [Self] {
32 &[Self::Entity, Self::Concept, Self::Synthesis]
33 }
34}
35
36impl std::fmt::Display for Kind {
37 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
38 f.write_str(self.as_str())
39 }
40}
41
42#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
44#[serde(rename_all = "lowercase")]
45pub enum Status {
46 Active,
48 Superseded,
50 Stale,
52 Deprecated,
54}
55
56impl Status {
57 #[must_use]
59 pub fn as_str(self) -> &'static str {
60 match self {
61 Self::Active => "active",
62 Self::Superseded => "superseded",
63 Self::Stale => "stale",
64 Self::Deprecated => "deprecated",
65 }
66 }
67
68 #[must_use]
70 pub fn defaults() -> &'static [Self] {
71 &[
72 Self::Active,
73 Self::Superseded,
74 Self::Stale,
75 Self::Deprecated,
76 ]
77 }
78}
79
80impl std::fmt::Display for Status {
81 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
82 f.write_str(self.as_str())
83 }
84}