A simple, safe way to implement Windows services in Rust.
- π¦ crates.io
- π docs.rs
- π Getting started
- π Source
windows-services lets you write a Windows service process with a builder. Use
Service::new to declare which control commands the service accepts (can_stop,
can_pause, β¦), then run to hand control to the service control manager. Your
closure receives the service handle and each incoming command.
The remainder of this page covers how the crate is built and maintained. It is
for contributors and is not needed to use windows-services.
src/bindings.rs is generated by tool_bindings from
crates/tools/bindings/src/services.txt; the service runtime and dispatch glue
are hand-written.
Run cargo test -p windows-services; see also the workspace test crates.