diff options
| author | Andrew Guschin <guschin@altlinux.org> | 2026-10-30 03:32:00 +0400 |
|---|---|---|
| committer | Andrew Guschin <guschin@altlinux.org> | 2026-10-30 03:32:00 +0400 |
| commit | fc3c1d51b1be9db6ba6ad286584fbc34bb305f38 (patch) | |
| tree | d23628e0534f0a4646c111c2ef6dd1501f18ae17 /src/model.rs | |
| parent | d608ffeeda1a479c9dc0e5f6ad269ba07a510d7f (diff) | |
Fix protected activation ordering and diagnostic review findings
Diffstat (limited to 'src/model.rs')
| -rw-r--r-- | src/model.rs | 19 |
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>, } |