Crates.io | cpulist |
lib.rs | cpulist |
version | 0.2.9 |
created_at | 2025-03-08 05:34:56.15248+00 |
updated_at | 2025-07-08 18:17:01.143169+00 |
description | Parse and emit the Linux 'cpulist' data format used to list processors, memory regions and similar entities |
homepage | |
repository | https://github.com/folo-rs/folo |
max_upload_size | |
id | 1584105 |
size | 23,891 |
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.