diff options
author | metamuffin <metamuffin@disroot.org> | 2023-12-16 01:08:15 +0100 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2023-12-16 01:08:15 +0100 |
commit | af99c406af8ee47bee38708cf23e86af826e41ba (patch) | |
tree | 23498a36f813454c2edea46906f812d929ba792e /common/src/user.rs | |
parent | 21b58037c69798e922c5512ea5380943781558ff (diff) | |
download | jellything-af99c406af8ee47bee38708cf23e86af826e41ba.tar jellything-af99c406af8ee47bee38708cf23e86af826e41ba.tar.bz2 jellything-af99c406af8ee47bee38708cf23e86af826e41ba.tar.zst |
watch progress and some draft ui
Diffstat (limited to 'common/src/user.rs')
-rw-r--r-- | common/src/user.rs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/common/src/user.rs b/common/src/user.rs index f33ca71..8807772 100644 --- a/common/src/user.rs +++ b/common/src/user.rs @@ -14,6 +14,19 @@ pub struct User { pub permissions: PermissionSet, } +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct NodeUserData { + pub watched: WatchedState, +} + +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(rename_all = "snake_case")] +pub enum WatchedState { + None, + Progress(f64), + Watched, +} + #[derive(Debug, Clone, Copy, Serialize, Deserialize, PartialEq)] #[cfg_attr(feature = "rocket", derive(FromFormField, UriDisplayQuery))] #[serde(rename_all = "snake_case")] @@ -94,3 +107,11 @@ impl Display for UserPermission { }) } } + +impl Default for NodeUserData { + fn default() -> Self { + Self { + watched: WatchedState::None, + } + } +} |