user_lookup

Module sync_reader

Source
Expand description

sync_reader provides readers for PasswdReader and GroupReader, to read and process /etc/passwd and /etc/group

 use user_lookup::sync_reader::PasswdReader;
 use std::time::Duration;

 fn main() {
    let mut reader = PasswdReader::new(Duration::new(0,0));

    println!("User with uid 1000 is: {}",
    reader.get_username_by_uid(1000).unwrap().unwrap());
 }

Structs§

GroupReader
The main entity to reaad and lookup groups information. It supports caching the information to avoid having to read the information from disk more than needed.
PasswdReader
The main entity to reaad and lookup user information. It supports caching the information to avoid having to read the information from disk more than needed.