rustilege 0.6.5

Rust library allowing you to recover current privileges under Windows
docs.rs failed to build rustilege-0.6.5
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.

rustilege

Rust library allowing you to recover current privileges under Windows

Use

use rustilege::{
    Rustilege,
    IntegrityLevel,
};


fn main() {

    match Rustilege::get_current_integrity_level() {

        Ok(level) => {

            match level {

                IntegrityLevel::System => {
                    println!("Process running as SYSTEM");
                }


                IntegrityLevel::Administrator => {
                    println!("Administrator privileges");
                }


                IntegrityLevel::User => {
                    println!("Standard user");
                }


                IntegrityLevel::Low => {
                    println!("Low integrity process");
                }


                IntegrityLevel::Guest => {
                    println!("Guest process");
                }
            }
        }


        Err(error) => {
            eprintln!(
                "Failed getting integrity level: {:?}",
                error
            );
        }
    }
}