Expand description
§Windows services
The windows-services crate provides a simple and safe way to implement Windows services in Rust.
Start by adding the following to your Cargo.toml file:
[dependencies.windows-services]
version = "0.26"
Use the Windows services support as needed. Here is how you might write a simple Windows services process:
fn main() {
windows_services::Service::new()
.can_pause()
.can_stop()
.run(|service, command| {
// Respond to service commands...
})
.unwrap();
}
Structs§
- Extended
Command - A command not specifically covered by the
Command
enum. - Service
- A service builder, providing control over what commands the service supports before the service begins to run.