39 lines
753 B
Rust
39 lines
753 B
Rust
use std::sync::{Arc, Mutex};
|
|
|
|
#[derive(Clone, Debug)]
|
|
pub enum ChromiumPhase {
|
|
Idle,
|
|
Checking,
|
|
Downloading,
|
|
Ready,
|
|
Error(String),
|
|
}
|
|
impl Default for ChromiumPhase {
|
|
fn default() -> Self { ChromiumPhase::Idle }
|
|
}
|
|
|
|
#[derive(Clone, Debug)]
|
|
pub enum HeadlessPhase {
|
|
Idle,
|
|
Starting,
|
|
Ready,
|
|
Error(String),
|
|
}
|
|
impl Default for HeadlessPhase {
|
|
fn default() -> Self { HeadlessPhase::Idle }
|
|
}
|
|
|
|
#[derive(Default, Clone)]
|
|
pub struct Status {
|
|
pub web_server_active: bool,
|
|
pub plugin_engine_active: bool,
|
|
pub chromium: ChromiumPhase,
|
|
pub headless: HeadlessPhase,
|
|
pub loaded_plugins: Vec<String>,
|
|
pub running_jobs: Vec<String>,
|
|
|
|
|
|
}
|
|
|
|
// Shared State Handle
|
|
pub type SharedState = Arc<Mutex<Status>>;
|