[][src]Function users::get_group_by_gid

pub fn get_group_by_gid(gid: gid_t) -> Option<Group>

Searches for a Group with the given ID in the system’s group database. Returns it if one is found, otherwise returns None.

libc functions used

Examples

use users::get_group_by_gid;

match get_group_by_gid(102) {
    Some(group) => println!("Found group {:?}", group.name()),
    None        => println!("Group not found"),
}