Skip to content

firestack/system_shutdown

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

system_shutdown

Build Status 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.

Example

The example below shows how to shut down the machine:

extern crate system_shutdown;

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.

Usage

Add this to your Cargo.toml:

[dependencies]
system_shutdown = "3.0.0"

and this to your crate root:

extern crate system_shutdown;

Contributions

Pull Requests and Issues are welcome!

License

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

About

Rust library to shut down, reboot or log out the system.

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Rust 100.0%