restart-manager
Safe, human-friendly Restart Manager workflows for Rust applications that need to find, stop, and restart the Windows processes locking their files.
Installation
cargo add restart-manager
The default API is blocking. Enable the optional Tokio API when needed:
cargo add restart-manager --features tokio
Example
Inspect the applications affected by replacing a file:
use RestartSession;
Important behavior
- Native operations are Windows-only. Public types remain available on other
targets, where OS operations return
ErrorKind::UnsupportedPlatform. - Shutdown produces an owned
RestartPendingrecovery value. It must be restarted or explicitly completed withleave_stopped; dropping it makes one best-effort restart attempt before ending the session. - Forced shutdown is opt-in and can cause applications to lose data.
- Restart Manager can relaunch only services and applications that registered themselves for restart.
- Tokio shutdown/restart futures use
tokio::AsyncOperationError<T>. Itsstate()isSomeonly when a callback-lease conflict proves that native work never began; worker failures returnNonerather than a misleading retryable typestate.
More information
- API documentation
- Blocking examples and installer workflow
- Tokio installer example
- Changelog
- Security policy
- Contributing
License
Licensed under either MIT or Apache-2.0, at your option.