Skip to main content

systemprompt_logging/services/cli/
types.rs

1#[derive(Debug, Clone, Copy, PartialEq, Eq)]
2pub enum ItemStatus {
3    Missing,
4    Applied,
5    Failed,
6    Valid,
7    Disabled,
8    Pending,
9}
10
11#[derive(Debug, Clone, Copy, PartialEq, Eq)]
12pub enum ModuleType {
13    Schema,
14    Seed,
15    Module,
16    Configuration,
17}
18
19#[derive(Debug, Clone, Copy, PartialEq, Eq)]
20pub enum MessageLevel {
21    Success,
22    Warning,
23    Error,
24    Info,
25}
26
27#[derive(Debug, Clone, Copy)]
28pub enum IconType {
29    Status(ItemStatus),
30    Module(ModuleType),
31    Message(MessageLevel),
32    Action(ActionType),
33}
34
35#[derive(Debug, Clone, Copy)]
36pub enum ColorType {
37    Status(ItemStatus),
38    Message(MessageLevel),
39    Emphasis(EmphasisType),
40}
41
42#[derive(Debug, Clone, Copy)]
43pub enum ActionType {
44    Install,
45    Update,
46    Arrow,
47}
48
49#[derive(Debug, Clone, Copy)]
50pub enum EmphasisType {
51    Highlight,
52    Dim,
53    Bold,
54    Underlined,
55}
56
57impl From<ItemStatus> for IconType {
58    fn from(status: ItemStatus) -> Self {
59        Self::Status(status)
60    }
61}
62
63impl From<ModuleType> for IconType {
64    fn from(module_type: ModuleType) -> Self {
65        Self::Module(module_type)
66    }
67}
68
69impl From<MessageLevel> for IconType {
70    fn from(level: MessageLevel) -> Self {
71        Self::Message(level)
72    }
73}
74
75impl From<ActionType> for IconType {
76    fn from(action: ActionType) -> Self {
77        Self::Action(action)
78    }
79}
80
81impl From<ItemStatus> for ColorType {
82    fn from(status: ItemStatus) -> Self {
83        Self::Status(status)
84    }
85}
86
87impl From<MessageLevel> for ColorType {
88    fn from(level: MessageLevel) -> Self {
89        Self::Message(level)
90    }
91}
92
93impl From<EmphasisType> for ColorType {
94    fn from(emphasis: EmphasisType) -> Self {
95        Self::Emphasis(emphasis)
96    }
97}