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), } }