system_shutdown

Crates.iosystem_shutdown
lib.rssystem_shutdown
version4.1.0
created_at2019-12-17 14:58:50.81322+00
updated_at2026-01-17 21:40:59.101914+00
descriptionRust library for shut down, reboot or log out operations.
homepagehttps://github.com/risoflora/system_shutdown
repositoryhttps://github.com/risoflora/system_shutdown
max_upload_size
id190014
size66,816
(AdrianEddy)

documentation

README

system_shutdown

CI/CD Crates.io Documentation License

system_shutdown provides a cross platform way to shut down, reboot or log out operations.

Supported platforms: Linux, Windows and macOS.

Usage

Add this to your Cargo.toml:

[dependencies]
system_shutdown = "*"

and then:

use system_shutdown::shutdown;

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

In most of the systems it does not requires the user to be root/admin.

Contributions

Pull Requests are welcome! =)

License

system_shutdown is licensed under either of the following, at your option:

Commit count: 45

cargo fmt