pub mod loader;
pub mod service;
use anyhow::Result;
use scx_loader::SchedMode;
#[derive(Debug, Clone, Copy)]
pub struct Capabilities {
pub live_switch: bool,
pub modes: bool,
pub restore_default: bool,
}
#[derive(Debug, Clone)]
pub struct Status {
pub current: Option<String>,
pub mode: SchedMode,
pub args: Vec<String>,
pub default_sched: Option<String>,
pub default_mode: SchedMode,
}
pub trait SchedulerBackend {
fn label(&self) -> &'static str;
fn capabilities(&self) -> Capabilities;
fn status(&self) -> Result<Status>;
fn supported_schedulers(&self) -> Result<Vec<String>>;
fn configured_modes(&self, sched: &str) -> Result<Vec<SchedMode>>;
fn start(&self, sched: &str, mode: SchedMode) -> Result<()>;
fn switch(&self, sched: &str, mode: SchedMode) -> Result<()>;
fn stop(&self) -> Result<()>;
fn restart(&self) -> Result<()>;
fn restore_default(&self) -> Result<()>;
}