pub enum Supervisor {
Launchd,
Systemd,
}Expand description
The service manager this machine runs.
Variants§
Implementations§
Source§impl Supervisor
impl Supervisor
Sourcepub fn detect() -> Option<Supervisor>
pub fn detect() -> Option<Supervisor>
What this machine has, if it has one.
By operating system rather than by probing for the binary: a mac
without launchctl is a broken mac, and guessing systemd there
would produce a unit file nothing will ever read.
Sourcepub fn render(
self,
exe: &Path,
state: &Path,
port: u16,
extra: &[String],
) -> String
pub fn render( self, exe: &Path, state: &Path, port: u16, extra: &[String], ) -> String
The unit file’s contents.
extra is forwarded to the daemon after --, the same spelling
a person would type, so a supervised node and a hand-started one
are the same command with the same arguments.
Sourcepub fn argv(
self,
exe: &Path,
state: &Path,
port: u16,
extra: &[String],
) -> Vec<String>
pub fn argv( self, exe: &Path, state: &Path, port: u16, extra: &[String], ) -> Vec<String>
The command the unit runs, as argv.
Shared by both renderings so the two supervisors cannot come to disagree about what a supervised node is.
Sourcepub fn commands(self, action: Action, home: &Path) -> Vec<Vec<String>>
pub fn commands(self, action: Action, home: &Path) -> Vec<Vec<String>>
The commands that load, stop and remove the unit, in order.
Returned as data rather than run here so a test can assert on what would be run without a service manager being involved, and so the caller can print them when it refuses.
Trait Implementations§
Source§impl Clone for Supervisor
impl Clone for Supervisor
Source§fn clone(&self) -> Supervisor
fn clone(&self) -> Supervisor
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for Supervisor
impl Debug for Supervisor
Source§impl PartialEq for Supervisor
impl PartialEq for Supervisor
Source§fn eq(&self, other: &Supervisor) -> bool
fn eq(&self, other: &Supervisor) -> bool
self and other values to be equal, and is used by ==.