pub trait ServiceManager: Send + Sync {
// Required methods
fn install(&self, config: &ServiceConfig) -> Result<InstallResult>;
fn uninstall(&self) -> Result<()>;
fn is_installed(&self) -> Result<bool>;
fn service_file_path(&self) -> PathBuf;
fn service_name(&self) -> &str;
}Expand description
Trait for platform-specific service managers
Implementations handle the details of registering services with systemd (Linux) or launchd (macOS).
Required Methods§
Sourcefn install(&self, config: &ServiceConfig) -> Result<InstallResult>
fn install(&self, config: &ServiceConfig) -> Result<InstallResult>
Install the service with the given configuration
Creates the service file and registers it with the init system. Also starts the service immediately after registration.
Sourcefn uninstall(&self) -> Result<()>
fn uninstall(&self) -> Result<()>
Uninstall the service
Stops the service if running and removes the registration.
Sourcefn is_installed(&self) -> Result<bool>
fn is_installed(&self) -> Result<bool>
Check if the service is currently installed
Sourcefn service_file_path(&self) -> PathBuf
fn service_file_path(&self) -> PathBuf
Get the path to the service file
Sourcefn service_name(&self) -> &str
fn service_name(&self) -> &str
Get the service name