Crate windows_services

Crate windows_services 

Source
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§

ExtendedCommand
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.

Enums§

Command
The commands are sent by the service control manager to the service through the closure or callback passed to the service run method.
State
Possible service states including transitional states.