Skip to main content

Backend

Trait Backend 

Source
pub trait Backend {
    // Required methods
    fn label(&self) -> String;
    fn list(&self) -> Result<Listing>;
    fn start(&self, id: &str) -> Result<String>;
    fn run(&self, sched: &str, args: &[String]) -> Result<String>;
    fn stop(&self) -> Result<String>;
    fn escalates(&self) -> bool;
}

Required Methods§

Source

fn label(&self) -> String

Short description for the header line.

Source

fn list(&self) -> Result<Listing>

scxcli list --json.

Source

fn start(&self, id: &str) -> Result<String>

scxcli start ID: default, or a scheduler by name with its defaults. Returns scxcli’s one-line report; the state comes back through Self::list.

Source

fn run(&self, sched: &str, args: &[String]) -> Result<String>

scxcli run SCHED ARGS....

Source

fn stop(&self) -> Result<String>

scxcli stop: the unit stops, the selection stays.

Source

fn escalates(&self) -> bool

Whether the privileged commands go through pkexec, which may prompt on the terminal and so needs it handed over.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§