pub enum TypedServiceManager {
Launchd(LaunchdServiceManager),
OpenRc(OpenRcServiceManager),
Rcd(RcdServiceManager),
Sc(ScServiceManager),
Systemd(SystemdServiceManager),
}Expand description
Represents an implementation of a known ServiceManager
Variants
Launchd(LaunchdServiceManager)
OpenRc(OpenRcServiceManager)
Rcd(RcdServiceManager)
Sc(ScServiceManager)
Systemd(SystemdServiceManager)
Implementations
sourceimpl TypedServiceManager
impl TypedServiceManager
sourcepub fn target_or_native(
kind: impl Into<Option<ServiceManagerKind>>
) -> Result<Self>
pub fn target_or_native(
kind: impl Into<Option<ServiceManagerKind>>
) -> Result<Self>
Creates a new service using the specified type, falling back to selecting based on native service manager for the current operating system if no type provided
sourcepub fn target(kind: ServiceManagerKind) -> Self
pub fn target(kind: ServiceManagerKind) -> Self
Creates a new service manager targeting the specific service manager kind using the default service manager instance
sourcepub fn native() -> Result<Self>
pub fn native() -> Result<Self>
Attempts to select the native service manager for the current operating system
- For MacOS, this will use
LaunchdServiceManager - For Windows, this will use
ScServiceManager - For BSD variants, this will use
RcdServiceManager - For Linux variants, this will use either
SystemdServiceManagerorOpenRcServiceManager
sourcepub fn into_box(self) -> Box<dyn ServiceManager>
pub fn into_box(self) -> Box<dyn ServiceManager>
Consumes underlying ServiceManager and moves it onto the heap
sourcepub fn is_launchd(&self) -> bool
pub fn is_launchd(&self) -> bool
Returns true if ServiceManager instance is for launchd
sourcepub fn is_openrc(&self) -> bool
pub fn is_openrc(&self) -> bool
Returns true if ServiceManager instance is for OpenRC
sourcepub fn is_rc_d(&self) -> bool
pub fn is_rc_d(&self) -> bool
Returns true if ServiceManager instance is for rc.d
sourcepub fn is_sc(&self) -> bool
pub fn is_sc(&self) -> bool
Returns true if ServiceManager instance is for sc
sourcepub fn is_systemd(&self) -> bool
pub fn is_systemd(&self) -> bool
Returns true if ServiceManager instance is for systemd
Trait Implementations
sourceimpl Clone for TypedServiceManager
impl Clone for TypedServiceManager
sourcefn clone(&self) -> TypedServiceManager
fn clone(&self) -> TypedServiceManager
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl Debug for TypedServiceManager
impl Debug for TypedServiceManager
sourceimpl From<LaunchdServiceManager> for TypedServiceManager
impl From<LaunchdServiceManager> for TypedServiceManager
sourcefn from(manager: LaunchdServiceManager) -> Self
fn from(manager: LaunchdServiceManager) -> Self
Converts to this type from the input type.
sourceimpl From<OpenRcServiceManager> for TypedServiceManager
impl From<OpenRcServiceManager> for TypedServiceManager
sourcefn from(manager: OpenRcServiceManager) -> Self
fn from(manager: OpenRcServiceManager) -> Self
Converts to this type from the input type.
sourceimpl From<RcdServiceManager> for TypedServiceManager
impl From<RcdServiceManager> for TypedServiceManager
sourcefn from(manager: RcdServiceManager) -> Self
fn from(manager: RcdServiceManager) -> Self
Converts to this type from the input type.
sourceimpl From<ScServiceManager> for TypedServiceManager
impl From<ScServiceManager> for TypedServiceManager
sourcefn from(manager: ScServiceManager) -> Self
fn from(manager: ScServiceManager) -> Self
Converts to this type from the input type.
sourceimpl From<SystemdServiceManager> for TypedServiceManager
impl From<SystemdServiceManager> for TypedServiceManager
sourcefn from(manager: SystemdServiceManager) -> Self
fn from(manager: SystemdServiceManager) -> Self
Converts to this type from the input type.
sourceimpl PartialEq<TypedServiceManager> for TypedServiceManager
impl PartialEq<TypedServiceManager> for TypedServiceManager
sourcefn eq(&self, other: &TypedServiceManager) -> bool
fn eq(&self, other: &TypedServiceManager) -> bool
This method tests for self and other values to be equal, and is used
by ==. Read more
sourcefn ne(&self, other: &TypedServiceManager) -> bool
fn ne(&self, other: &TypedServiceManager) -> bool
This method tests for !=.
sourceimpl ServiceManager for TypedServiceManager
impl ServiceManager for TypedServiceManager
sourcefn available(&self) -> Result<bool>
fn available(&self) -> Result<bool>
Determines if the service manager exists (e.g. is launchd available on the system?) and
can be used Read more
sourcefn install(&self, ctx: ServiceInstallCtx) -> Result<()>
fn install(&self, ctx: ServiceInstallCtx) -> Result<()>
Installs a new service using the manager
sourcefn uninstall(&self, ctx: ServiceUninstallCtx) -> Result<()>
fn uninstall(&self, ctx: ServiceUninstallCtx) -> Result<()>
Uninstalls an existing service using the manager
sourcefn start(&self, ctx: ServiceStartCtx) -> Result<()>
fn start(&self, ctx: ServiceStartCtx) -> Result<()>
Starts a service using the manager
sourcefn stop(&self, ctx: ServiceStopCtx) -> Result<()>
fn stop(&self, ctx: ServiceStopCtx) -> Result<()>
Stops a running service using the manager
sourcefn level(&self) -> ServiceLevel
fn level(&self) -> ServiceLevel
Returns the current target level for the manager
sourcefn set_level(&mut self, level: ServiceLevel) -> Result<()>
fn set_level(&mut self, level: ServiceLevel) -> Result<()>
Sets the target level for the manager
impl Eq for TypedServiceManager
impl StructuralEq for TypedServiceManager
impl StructuralPartialEq for TypedServiceManager
Auto Trait Implementations
impl RefUnwindSafe for TypedServiceManager
impl Send for TypedServiceManager
impl Sync for TypedServiceManager
impl Unpin for TypedServiceManager
impl UnwindSafe for TypedServiceManager
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more