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 reboot the machine.

use system_shutdown::reboot;

fn main() {
    match reboot() {
        Ok(_) => println!("Rebooting ..."),
        Err(error) => eprintln!("Failed to reboot: {}", error),
    }
}