Function users::get_user_groups [−][src]
pub fn get_user_groups<S: AsRef<OsStr> + ?Sized>(
username: &S,
gid: gid_t
) -> Option<Vec<Group>>
Returns groups for a provided user name and primary group id.
libc functions used
Examples
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.gid(), group.name()); }