W3cubDocs

/Rust

Function std::process::id

pub fn id() -> u32

Returns the OS-assigned process identifier associated with this process.

Examples

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