#[repr(C)]pub struct CpuSet { /* private fields */ }
Expand description
CpuSet represent a bit-mask of CPUs. CpuSets are used by sched_setaffinity and sched_getaffinity for example.
This is a wrapper around libc::cpu_set_t
.
Implementations§
source§impl CpuSet
impl CpuSet
sourcepub fn is_set(&self, field: usize) -> Result<bool>
pub fn is_set(&self, field: usize) -> Result<bool>
Test to see if a CPU is in the CpuSet.
field
is the CPU id to test
sourcepub fn set(&mut self, field: usize) -> Result<()>
pub fn set(&mut self, field: usize) -> Result<()>
Add a CPU to CpuSet.
field
is the CPU id to add
Trait Implementations§
source§impl PartialEq for CpuSet
impl PartialEq for CpuSet
impl Copy for CpuSet
impl Eq for CpuSet
impl StructuralPartialEq for CpuSet
Auto Trait Implementations§
impl Freeze for CpuSet
impl RefUnwindSafe for CpuSet
impl Send for CpuSet
impl Sync for CpuSet
impl Unpin for CpuSet
impl UnwindSafe for CpuSet
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)