Skip to main content

SystemCtl

Trait SystemCtl 

Source
pub trait SystemCtl {
    // Required methods
    fn systemctl(&self, args: &[&str]) -> Result<Output>;
    fn loginctl(&self, args: &[&str]) -> Result<Output>;
}
Expand description

Seam over the external systemctl --user / loginctl commands. The real impl shells out; tests substitute a fake that records the argument vectors and returns canned output, so install/uninstall/status are exercised without touching the host’s systemd.

Required Methods§

Source

fn systemctl(&self, args: &[&str]) -> Result<Output>

Run systemctl --user <args>.

Source

fn loginctl(&self, args: &[&str]) -> Result<Output>

Run loginctl <args>.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§