pub fn shutdown() -> ShutdownResult
Calls the OS-specific function to shut down the machine.
5fn main() { 6 match shutdown() { 7 Ok(_) => println!("Shutting down, bye!"), 8 Err(error) => eprintln!("Failed to shut down: {}", error), 9 } 10}