A simple Rust crate to get the number of CPU cores available to the current process.
Add this to your Cargo.toml:
Cargo.toml