async_user_lookup

Crates.ioasync_user_lookup
lib.rsasync_user_lookup
version0.1.3
sourcesrc
created_at2022-06-17 12:48:09.041609
updated_at2023-10-04 07:09:14.562559
descriptionA library to lookup user and groups on Unix/Linux. NOTE: This has been renamed to user_lookup to allow for both sync and async versions
homepagehttps://github.com/snaggen/user_lookup
repositoryhttps://github.com/snaggen/user_lookup
max_upload_size
id607964
size26,745
Mattias Eriksson (snaggen)

documentation

README

Async User Lookup

Crates.io Docs.rs

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.

use async_user_lookup::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