Struct lrs::thread::CpuMask

A bit-mask of CPUs.

Syntax

struct CpuMask {
    /* private fields */
}

Static methods

NameDescription
new

Creates a new mask from a buffer.

new_mut

Creates a new mask from a buffer.

Methods

ReceiverNameDescription
&selfcount

Returns the number of online CPUs in this mask.

&selflen

Returns the number of slots in this CPU mask.

&mut selfset

Marks a CPU as online.

&mut selfunset

Marks a CPU as offline.

Trait implementations

NameDescription
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.

Remarks

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().