Struct rustix::process::CpuSet
#[repr(C)]
pub struct CpuSet { /* fields hidden */ }
Documentation
CpuSet
represents a bit-mask of CPUs.
CpuSet
s are used by sched_setaffinity
and sched_getaffinity
, for
example.
References
Implementations
impl CpuSet
const MAX_CPU: usize = imp::process::CPU_SETSIZE
The maximum number of CPU in CpuSet
.
pub fn is_set(&Self, field: usize) -> bool
Test to see if a CPU is in the CpuSet
.
field
is the CPU id to test.
pub fn set(&mut Self, field: usize)
Add a CPU to CpuSet
.
field
is the CPU id to add.
pub fn unset(&mut Self, field: usize)
Remove a CPU from CpuSet
.
field
is the CPU id to remove.
pub fn count(&Self) -> u32
Count the number of CPUs set in the CpuSet
.
pub fn clear(&mut Self)
Zeroes the CpuSet
.
Trait Implementations
impl Debug for CpuSet
fn fmt(&Self, f: &mut $crate::fmt::Formatter<'_>) -> $crate::fmt::Result
impl Hash for CpuSet
fn hash<__H: $crate::hash::Hasher>(&Self, state: &mut __H) -> ()
impl StructuralEq for CpuSet
impl StructuralPartialEq for CpuSet
Auto Trait Implementations
impl RefUnwindSafe for CpuSet
impl UnwindSafe for CpuSet
Blanket Implementations
impl<T> BorrowMut<T> for T
where
T: ?Sized,
where
T: ?Sized,
fn borrow_mut(&mut Self) -> &mut T