pub fn get_user_groups(username: &str, gid: Gid) -> Option<Vec<Gid>>
Returns groups for a provided user name and primary group id.
getgrouplist
use users::get_user_groups; for group in get_user_groups("stevedore", 1001).expect("Error looking up groups") { println!("User is a member of group #{group}"); }