A very small Rust library to easily set up and run a Windows system service.
Cargo.toml
:
toml
[dependencies]
winservice = "0.1.1"
main.rs
:
```rust
use std::os::raw::{cchar, cint, c_void}; use std::sync::mpsc::Receiver;
extern crate winservice;
pub extern "system" fn WinMain(hInstance : *const cvoid, hPrevInstance : *const cvoid, lpCmdLine : *const cchar, nCmdShow : cint) -> cint { Service!("myService", servicemain) }
fn servicemain(args : Vec