Skip to main content

ServiceManager

Trait ServiceManager 

Source
pub trait ServiceManager: Send + Sync {
    // Required methods
    fn install(&self, spec: &ServiceSpec) -> Result<()>;
    fn start(&self, name: &str) -> Result<()>;
    fn stop(&self, name: &str) -> Result<()>;
    fn status(&self, name: &str) -> Result<ServiceState>;
    fn uninstall(&self, name: &str) -> Result<()>;
}
Expand description

One user-level service manager.

Required Methods§

Source

fn install(&self, spec: &ServiceSpec) -> Result<()>

Write the definition and register it (it starts at the next login, or at start).

Source

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

Source

fn stop(&self, name: &str) -> Result<()>

Source

fn status(&self, name: &str) -> Result<ServiceState>

Source

fn uninstall(&self, name: &str) -> Result<()>

Stop, unregister and delete the definition. A service that is not installed is not an error.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§