Crates.io | async_user_lookup |
lib.rs | async_user_lookup |
version | 0.1.3 |
source | src |
created_at | 2022-06-17 12:48:09.041609 |
updated_at | 2023-10-04 07:09:14.562559 |
description | A 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 |
homepage | https://github.com/snaggen/user_lookup |
repository | https://github.com/snaggen/user_lookup |
max_upload_size | |
id | 607964 |
size | 26,745 |
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());
}