Struct rustix::process::CpuSet
#[repr(C)]
pub struct CpuSet { /* fields hidden */ }Documentation
CpuSet represents a bit-mask of CPUs.
CpuSets 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::Resultimpl Hash for CpuSet
fn hash<__H: $crate::hash::Hasher>(&Self, state: &mut __H) -> ()impl StructuralEq for CpuSetimpl StructuralPartialEq for CpuSetAuto Trait Implementations
impl RefUnwindSafe for CpuSetimpl UnwindSafe for CpuSetBlanket Implementations
impl<T> BorrowMut<T> for T
where
T: ?Sized,
where
T: ?Sized,
fn borrow_mut(&mut Self) -> &mut T