Skip to content

Commit

Permalink
add SystemStart and BootStart start types
Browse files Browse the repository at this point in the history
  • Loading branch information
kkent030315 committed Dec 20, 2023
1 parent 436da87 commit 985b385
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ pub enum ServiceStartType {
OnDemand = Services::SERVICE_DEMAND_START,
/// Disabled service
Disabled = Services::SERVICE_DISABLED,
/// Start on system startup
SystemStart = Services::SERVICE_SYSTEM_START,
/// Start on OS boot
BootStart = Services::SERVICE_BOOT_START,
}

impl ServiceStartType {
Expand All @@ -105,6 +109,8 @@ impl ServiceStartType {
x if x == ServiceStartType::AutoStart.to_raw() => Ok(ServiceStartType::AutoStart),
x if x == ServiceStartType::OnDemand.to_raw() => Ok(ServiceStartType::OnDemand),
x if x == ServiceStartType::Disabled.to_raw() => Ok(ServiceStartType::Disabled),
x if x == ServiceStartType::SystemStart.to_raw() => Ok(ServiceStartType::SystemStart),
x if x == ServiceStartType::BootStart.to_raw() => Ok(ServiceStartType::BootStart),
_ => Err(ParseRawError::InvalidInteger(raw)),
}
}
Expand Down

0 comments on commit 985b385

Please sign in to comment.