This patch enables more expressive ways to slice and iterate over the `Id`s in an `IdSet` with `IdSet::iter_in`, which takes an arbitrary `IdSetSlicer`. `IdSet::iter_in` efficiently slices out unintended inner parts and then, within the remaining parts, skips inactive bits by using `BitSlice::iter_ones` from the `bitvec` crate. It also delivers several implementations of `IdSetSlicer` so OSTD consumers can represent `Id` ranges ergonomically. In the Asterinas kernel, `CpuSet::iter_in` enables a cleaner way to define an interator that cycles over the CPUs. |
||
|---|---|---|
| .. | ||
| comps | ||
| libs | ||
| src | ||
| Cargo.toml | ||