An easy way to lookup Linux/Unix user and group information from /etc/passwd and /etc/group. It uses tokio async and will cache the information for a duration specified by the user.
useasync_user_lookup::PasswdReader;usestd::time::Duration;#[tokio::main]
async fnmain(){letmut reader =PasswdReader::new(Duration::new(0,0));println!("User with uid 1000 is: {}", reader.get_username_by_uid(1000).await.unwrap().unwrap());}