//! [![crates.io](https://img.shields.io/crates/v/sudo?logo=rust)](https://crates.io/crates/sudo/)
//! [![docs.rs](https://docs.rs/sudo/badge.svg)](https://docs.rs/sudo)
//!
//! Detect if you are running as root, restart self with `sudo` if needed or setup uid zero when running with the SUID flag set.
//!
//! ## Requirements
//!
//! * The `sudo` program is required to be installed and setup correctly on the target system.
//! * Linux or Mac OS X tested
//! * It should work on *BSD. However, it is not tested.
use crate Root;
use crate User;
/// Cross platform representation of the state the current program running
/// This checks whether the current process is running as sudo or not.
/// Returns the RunningAs enum as result
/// # Examples
/// ```rust
/// use is_sudo::RunningAs;
/// let running_as = is_sudo::check();
/// match running_as {
/// RunningAs::Root => println!("Running as root"),
/// RunningAs::User => println!("Running as user"),
/// }
/// ```
// Use windows-rs crate to check admin permission in windows
/// This checks whether the current process is running as admin(root) or not.
/// Returns the RunningAs enum as result
/// # Examples
/// ```rust
/// use is_sudo::RunningAs;
/// let running_as = is_sudo::check();
/// match running_as {
/// RunningAs::Root => println!("Running as root"),
/// RunningAs::User => println!("Running as user"),
/// }
/// ```