pub struct WindowsScmManager { /* private fields */ }Expand description
Native Windows SCM adapter implementing the manager-neutral contract.
new is available on Windows. The ownership, command-line parser, and
deterministic backend tests are platform-independent. No sc.exe, shell,
ambient PATH, or automatic elevation is used.
§Errors
The adapter’s operations report the Service Control Manager’s conditions as
typed ServiceErrors and never as a panic:
- an access denial (OS code
5) becomesServiceError::ManagerwithManagerFailureKind::Permissionand a bounded remediation detail that names no elevation path; - a registration that disappeared before the operation — the SCM’s
1060(does not exist) and1072(marked for deletion) codes — becomesServiceError::Conflict; - any other SCM code becomes
ServiceError::Managerwith the raw OS code still reachable throughServiceError::manager_os_code; - an observation whose ownership is not
Ownedis denied withServiceError::OwnershipDenied.
Implementations§
Source§impl WindowsScmManager
impl WindowsScmManager
Sourcepub fn install_config(&self) -> &WindowsScmInstall
pub fn install_config(&self) -> &WindowsScmInstall
Returns the caller-owned descriptor.
Trait Implementations§
Source§impl Debug for WindowsScmManager
impl Debug for WindowsScmManager
Source§impl ServiceManager for WindowsScmManager
impl ServiceManager for WindowsScmManager
Source§fn inspect(&self, spec: &ServiceSpec) -> Result<LifecycleSnapshot, ServiceError>
fn inspect(&self, spec: &ServiceSpec) -> Result<LifecycleSnapshot, ServiceError>
Inspects registration and lifecycle state without mutating anything. Read more
Source§fn install(
&mut self,
spec: &ServiceSpec,
) -> Result<TransitionResult, ServiceError>
fn install( &mut self, spec: &ServiceSpec, ) -> Result<TransitionResult, ServiceError>
Source§fn start(
&mut self,
spec: &ServiceSpec,
timeout: Duration,
) -> Result<TransitionResult, ServiceError>
fn start( &mut self, spec: &ServiceSpec, timeout: Duration, ) -> Result<TransitionResult, ServiceError>
Source§fn stop(
&mut self,
spec: &ServiceSpec,
timeout: Duration,
) -> Result<TransitionResult, ServiceError>
fn stop( &mut self, spec: &ServiceSpec, timeout: Duration, ) -> Result<TransitionResult, ServiceError>
Source§fn restart(
&mut self,
spec: &ServiceSpec,
timeout: Duration,
) -> Result<TransitionResult, ServiceError>
fn restart( &mut self, spec: &ServiceSpec, timeout: Duration, ) -> Result<TransitionResult, ServiceError>
Source§fn uninstall(
&mut self,
spec: &ServiceSpec,
) -> Result<TransitionResult, ServiceError>
fn uninstall( &mut self, spec: &ServiceSpec, ) -> Result<TransitionResult, ServiceError>
Removes an
Owned registration. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for WindowsScmManager
impl !Send for WindowsScmManager
impl !Sync for WindowsScmManager
impl !UnwindSafe for WindowsScmManager
impl Freeze for WindowsScmManager
impl Unpin for WindowsScmManager
impl UnsafeUnpin for WindowsScmManager
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
Mutably borrows from an owned value. Read more