Back to Windows Rs

Readme

crates/libs/services/readme.md

73818 B
Original Source

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:

toml
[dependencies.windows-services]
version = "0.26"

Use the Windows services support as needed. Here is how you might write a simple Windows services process:

rust,no_run
fn main() {
    windows_services::Service::new()
        .can_pause()
        .can_stop()
        .run(|service, command| {
            // Respond to service commands...
        })
        .unwrap();
}