Crates.io | user_lookup |
lib.rs | user_lookup |
version | 0.3.0 |
source | src |
created_at | 2023-10-04 05:46:07.056021 |
updated_at | 2023-10-04 07:05:53.294928 |
description | A library to lookup user and groups on Unix/Linux |
homepage | https://github.com/snaggen/user_lookup |
repository | https://github.com/snaggen/user_lookup |
max_upload_size | |
id | 991892 |
size | 35,764 |
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());
}