Function users::get_user_by_name
source · [−]Expand description
Searches for a User
with the given username in the system’s user database.
Returns it if one is found, otherwise returns None
.
libc functions used
Examples
use users::get_user_by_name;
match get_user_by_name("stevedore") {
Some(user) => println!("Found user #{}", user.uid()),
None => println!("User not found"),
}