cpulist

Crates.iocpulist
lib.rscpulist
version0.2.9
created_at2025-03-08 05:34:56.15248+00
updated_at2025-07-08 18:17:01.143169+00
descriptionParse and emit the Linux 'cpulist' data format used to list processors, memory regions and similar entities
homepage
repositoryhttps://github.com/folo-rs/folo
max_upload_size
id1584105
size23,891
Sander Saares (sandersaares)

documentation

README

Utilities for parsing and emitting strings in the the cpulist format often used by Linux utilities that work with processor IDs, memory region IDs and similar numeric hardware identifiers.

Example cpulist string: 0,1,2-4,5-9:2,6-10:2

let selected_processors = cpulist::parse("0-9,32-35,40").unwrap();
assert_eq!(
    selected_processors,
    vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 32, 33, 34, 35, 40]
);

println!("Selected processors: {selected_processors:?}");
println!("As cpulist: {}", cpulist::emit(selected_processors));

More details in the package documentation.

This is part of the Folo project that provides mechanisms for high-performance hardware-aware programming in Rust.

Commit count: 810

cargo fmt