Function uzers::get_group_by_gid

source ·
pub fn get_group_by_gid(gid: gid_t) -> Option<Group>
Expand description

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 uzers::get_group_by_gid;

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