Skip to main content

uid

Function uid 

Source
pub fn uid() -> u32
🔬This is a nightly-only experimental API. (unix_process_user_group_ids #166252)
Available on Unix only.
Expand description

Returns the real user ID of the current process.

§Example

#![feature(unix_process_user_group_ids)]
use std::os::unix::process;

fn main() {
    let uid = process::uid();
    println!("The current process has UID {}", uid);
}