summaryrefslogtreecommitdiff
path: root/src/model.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/model.rs')
-rw-r--r--src/model.rs19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/model.rs b/src/model.rs
index 8966956..8229207 100644
--- a/src/model.rs
+++ b/src/model.rs
@@ -16,11 +16,28 @@ impl Trojan {
}
}
+#[derive(Clone, Copy, Serialize, Deserialize, PartialEq, Eq)]
+#[serde(rename_all = "lowercase")]
+pub enum EntryStatus {
+ Supported,
+ Unsupported,
+ Invalid,
+}
+impl EntryStatus {
+ pub fn as_str(self) -> &'static str {
+ match self {
+ Self::Supported => "supported",
+ Self::Unsupported => "unsupported",
+ Self::Invalid => "invalid",
+ }
+ }
+}
+
#[derive(Clone, Serialize, Deserialize)]
pub struct Entry {
pub id: String,
pub name: String,
- pub status: String,
+ pub status: EntryStatus,
pub explanation: Option<String>,
pub connection: Option<Trojan>,
}