Function users::get_effective_username [−][src]
pub fn get_effective_username() -> Option<OsString>
Returns the username of the effective user running the process.
libc functions used
Examples
use users::get_effective_username; match get_effective_username() { Some(uname) => println!("Running as effective user with name {:?}", uname), None => println!("The effective user does not exist!"), }