Function users::get_effective_username
source · [−]Expand description
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!"),
}