user_lookup

Crates.iouser_lookup
lib.rsuser_lookup
version0.3.0
sourcesrc
created_at2023-10-04 05:46:07.056021
updated_at2023-10-04 07:05:53.294928
descriptionA library to lookup user and groups on Unix/Linux
homepagehttps://github.com/snaggen/user_lookup
repositoryhttps://github.com/snaggen/user_lookup
max_upload_size
id991892
size35,764
Mattias Eriksson (snaggen)

documentation

README

User Lookup

Crates.io Docs.rs

An easy way to lookup Linux/Unix user and group information from /etc/passwd and /etc/group. It will cache the information for a duration specified by the user.

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

#[tokio::main]
async fn main() {
   let mut reader = PasswdReader::new(Duration::new(0,0));

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

Commit count: 12

cargo fmt