user_lookup 0.3.0

A library to lookup user and groups on Unix/Linux
Documentation
  • Coverage
  • 92.59%
    50 out of 54 items documented4 out of 40 items with examples
  • Size
  • Source code size: 37.03 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 3.12 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 12s Average build duration of successful builds.
  • all releases: 12s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • snaggen/user_lookup
    1 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • snaggen

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());
}