pub struct CpuMask { /* private fields */ }Expand description
A set of CPUs, one bit per core.
Implementations§
Source§impl CpuMask
impl CpuMask
pub fn get(&self, core: usize) -> bool
pub fn set(&mut self, core: usize, on: bool)
pub fn toggle(&mut self, core: usize)
Sourcepub fn from_bytes(bytes: &[u8], cores: usize) -> Self
pub fn from_bytes(bytes: &[u8], cores: usize) -> Self
Build from raw bytes, as returned by sched_getaffinity.
pub fn count(&self) -> usize
pub fn is_empty(&self) -> bool
Trait Implementations§
impl Eq for CpuMask
impl StructuralPartialEq for CpuMask
Auto Trait Implementations§
impl Freeze for CpuMask
impl RefUnwindSafe for CpuMask
impl Send for CpuMask
impl Sync for CpuMask
impl Unpin for CpuMask
impl UnsafeUnpin for CpuMask
impl UnwindSafe for CpuMask
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: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more