How to Use Thread Pools in Rust

Use the external `rayon` crate to implement thread pools in Rust for efficient parallel data processing.

Rust does not have a built-in thread pool in the standard library; you must use the rayon crate for data parallelism or tokio for async tasks. Add rayon to your Cargo.toml and use par_iter() to parallelize work across available threads.

[dependencies]
rayon = "1.10"
use rayon::prelude::*;

fn main() {
    let v: Vec<i32> = (0..100).collect();
    let sum: i32 = v.par_iter().sum();
    println!("Sum: {}", sum);
}