You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
771 B
Rust
33 lines
771 B
Rust
use std::sync::Mutex;
|
|
|
|
use serde::{Deserialize, Serialize};
|
|
|
|
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
|
|
#[serde(rename_all = "camelCase")]
|
|
pub struct SessionState {
|
|
pub emp_uid: Option<i64>,
|
|
pub win_uid: Option<i64>,
|
|
pub queue_token: Option<String>,
|
|
}
|
|
|
|
pub struct AppState {
|
|
pub session: Mutex<SessionState>,
|
|
pub screen_sync: Mutex<ScreenSyncState>,
|
|
}
|
|
|
|
#[derive(Default)]
|
|
pub struct ScreenSyncState {
|
|
pub ffmpeg: Option<std::process::Child>,
|
|
pub notify_base_url: Option<String>,
|
|
pub stream_url: Option<String>,
|
|
}
|
|
|
|
impl Default for AppState {
|
|
fn default() -> Self {
|
|
Self {
|
|
session: Mutex::new(SessionState::default()),
|
|
screen_sync: Mutex::new(ScreenSyncState::default()),
|
|
}
|
|
}
|
|
}
|