pub enum TypedServiceManager {
Launchd(LaunchdServiceManager),
OpenRc(OpenRcServiceManager),
Rcd(RcdServiceManager),
Sc(ScServiceManager),
Systemd(SystemdServiceManager),
WinSw(WinSwServiceManager),
}
Expand description
Represents an implementation of a known ServiceManager
Variants§
Launchd(LaunchdServiceManager)
OpenRc(OpenRcServiceManager)
Rcd(RcdServiceManager)
Sc(ScServiceManager)
Systemd(SystemdServiceManager)
WinSw(WinSwServiceManager)
Implementations§
Source§impl 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
SystemdServiceManager
orOpenRcServiceManager
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
Sourcepub fn is_winsw(&self) -> bool
pub fn is_winsw(&self) -> bool
Returns true if ServiceManager
instance is for winsw
Trait Implementations§
Source§impl Clone for TypedServiceManager
impl Clone for TypedServiceManager
Source§fn clone(&self) -> TypedServiceManager
fn clone(&self) -> TypedServiceManager
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for TypedServiceManager
impl Debug for TypedServiceManager
Source§impl From<LaunchdServiceManager> for TypedServiceManager
impl From<LaunchdServiceManager> for TypedServiceManager
Source§fn from(manager: LaunchdServiceManager) -> Self
fn from(manager: LaunchdServiceManager) -> Self
Source§impl From<OpenRcServiceManager> for TypedServiceManager
impl From<OpenRcServiceManager> for TypedServiceManager
Source§fn from(manager: OpenRcServiceManager) -> Self
fn from(manager: OpenRcServiceManager) -> Self
Source§impl From<RcdServiceManager> for TypedServiceManager
impl From<RcdServiceManager> for TypedServiceManager
Source§fn from(manager: RcdServiceManager) -> Self
fn from(manager: RcdServiceManager) -> Self
Source§impl From<ScServiceManager> for TypedServiceManager
impl From<ScServiceManager> for TypedServiceManager
Source§fn from(manager: ScServiceManager) -> Self
fn from(manager: ScServiceManager) -> Self
Source§impl From<SystemdServiceManager> for TypedServiceManager
impl From<SystemdServiceManager> for TypedServiceManager
Source§fn from(manager: SystemdServiceManager) -> Self
fn from(manager: SystemdServiceManager) -> Self
Source§impl From<WinSwServiceManager> for TypedServiceManager
impl From<WinSwServiceManager> for TypedServiceManager
Source§fn from(manager: WinSwServiceManager) -> Self
fn from(manager: WinSwServiceManager) -> Self
Source§impl PartialEq for TypedServiceManager
impl PartialEq for TypedServiceManager
Source§impl ServiceManager for TypedServiceManager
impl ServiceManager for TypedServiceManager
Source§fn available(&self) -> Result<bool>
fn available(&self) -> Result<bool>
launchd
available on the system?) and
can be usedSource§fn install(&self, ctx: ServiceInstallCtx) -> Result<()>
fn install(&self, ctx: ServiceInstallCtx) -> Result<()>
Source§fn uninstall(&self, ctx: ServiceUninstallCtx) -> Result<()>
fn uninstall(&self, ctx: ServiceUninstallCtx) -> Result<()>
Source§fn level(&self) -> ServiceLevel
fn level(&self) -> ServiceLevel
Source§fn set_level(&mut self, level: ServiceLevel) -> Result<()>
fn set_level(&mut self, level: ServiceLevel) -> Result<()>
Source§fn status(&self, ctx: ServiceStatusCtx) -> Result<ServiceStatus>
fn status(&self, ctx: ServiceStatusCtx) -> Result<ServiceStatus>
impl Eq for TypedServiceManager
impl StructuralPartialEq for TypedServiceManager
Auto Trait Implementations§
impl Freeze for TypedServiceManager
impl RefUnwindSafe for TypedServiceManager
impl Send for TypedServiceManager
impl Sync for TypedServiceManager
impl Unpin for TypedServiceManager
impl UnwindSafe for TypedServiceManager
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.