pub fn id() -> u32
Returns the OS-assigned process identifier associated with this process.
Basic usage:
use std::process; println!("My pid is {}", process::id());
© 2010 The Rust Project Developers
Licensed under the Apache License, Version 2.0 or the MIT license, at your option.
https://doc.rust-lang.org/std/process/fn.id.html