A bit-mask of CPUs.
struct CpuMask {
/* private fields */
}| Name | Description |
|---|---|
| new | Creates a new mask from a buffer. |
| new_mut | Creates a new mask from a buffer. |
| Receiver | Name | Description |
|---|---|---|
&self | count | Returns the number of online CPUs in this mask. |
&self | len | Returns the number of slots in this CPU mask. |
&mut self | set | Marks a CPU as online. |
&mut self | unset | Marks a CPU as offline. |
| Name | Description |
|---|---|
| Debug | Objects that can be formatted in a "debug" form. |
| Deref | Objects that implement the immutable dereference operator. |
| DerefMut | Objects that implement the mutable dereference operator. |
| Index | Objects that implement the immutable subscript operator. |
The CPUs are stored in form of a [u8] such that available CPUs are stored as a 1 bit and unavailable CPUs are stored as a 0 bit. The structure supports indexing to check whether a CPU is available: let have_one = mask[0]. The value used to index must be at most mask.len().