system_shutdown 4.1.0

Rust library for shut down, reboot or log out operations.
Documentation
1
2
3
4
5
6
7
8
9
10
//! How to shut down the machine.

use system_shutdown::shutdown;

fn main() {
    match shutdown() {
        Ok(_) => println!("Shutting down, bye!"),
        Err(error) => eprintln!("Failed to shut down: {}", error),
    }
}