pub struct CpuBindFlags { /* private fields */ }Expand description
Process/Thread binding flags.
These bit flags can be used to refine the binding policy.
The default (Process) is to bind the current process, assumed to be single-threaded, in a non-strict way. This is the most portable way to bind as all operating systems usually provide it.
Note: Not all systems support all kinds of binding.
The following flags (constants) are available:
- CPUBIND_PROCESS: Bind all threads of the current (possibly) multithreaded process.
- CPUBIND_THREAD: Bind current thread of current process.
- CPUBIND_STRICT: Request for strict binding from the OS.
- CPUBIND_NO_MEMBIND: Avoid any effect on memory binding.
Implementations§
Source§impl CpuBindFlags
impl CpuBindFlags
Sourcepub fn empty() -> CpuBindFlags
pub fn empty() -> CpuBindFlags
Returns an empty set of flags.
Sourcepub fn all() -> CpuBindFlags
pub fn all() -> CpuBindFlags
Returns the set containing all flags.
Sourcepub fn from_bits(bits: i32) -> Option<CpuBindFlags>
pub fn from_bits(bits: i32) -> Option<CpuBindFlags>
Convert from underlying bit representation, unless that representation contains bits that do not correspond to a flag.
Sourcepub fn from_bits_truncate(bits: i32) -> CpuBindFlags
pub fn from_bits_truncate(bits: i32) -> CpuBindFlags
Convert from underlying bit representation, dropping any bits that do not correspond to flags.
Sourcepub fn intersects(&self, other: CpuBindFlags) -> bool
pub fn intersects(&self, other: CpuBindFlags) -> bool
Returns true if there are flags common to both self and other.
Sourcepub fn contains(&self, other: CpuBindFlags) -> bool
pub fn contains(&self, other: CpuBindFlags) -> bool
Returns true all of the flags in other are contained within self.
Sourcepub fn insert(&mut self, other: CpuBindFlags)
pub fn insert(&mut self, other: CpuBindFlags)
Inserts the specified flags in-place.
Sourcepub fn remove(&mut self, other: CpuBindFlags)
pub fn remove(&mut self, other: CpuBindFlags)
Removes the specified flags in-place.
Sourcepub fn toggle(&mut self, other: CpuBindFlags)
pub fn toggle(&mut self, other: CpuBindFlags)
Toggles the specified flags in-place.
Trait Implementations§
Source§impl BitAnd for CpuBindFlags
impl BitAnd for CpuBindFlags
Source§fn bitand(self, other: CpuBindFlags) -> CpuBindFlags
fn bitand(self, other: CpuBindFlags) -> CpuBindFlags
Returns the intersection between the two sets of flags.
Source§type Output = CpuBindFlags
type Output = CpuBindFlags
& operator.Source§impl BitAndAssign for CpuBindFlags
impl BitAndAssign for CpuBindFlags
Source§fn bitand_assign(&mut self, other: CpuBindFlags)
fn bitand_assign(&mut self, other: CpuBindFlags)
Disables all flags disabled in the set.
Source§impl BitOr for CpuBindFlags
impl BitOr for CpuBindFlags
Source§fn bitor(self, other: CpuBindFlags) -> CpuBindFlags
fn bitor(self, other: CpuBindFlags) -> CpuBindFlags
Returns the union of the two sets of flags.
Source§type Output = CpuBindFlags
type Output = CpuBindFlags
| operator.Source§impl BitOrAssign for CpuBindFlags
impl BitOrAssign for CpuBindFlags
Source§fn bitor_assign(&mut self, other: CpuBindFlags)
fn bitor_assign(&mut self, other: CpuBindFlags)
Adds the set of flags.
Source§impl BitXor for CpuBindFlags
impl BitXor for CpuBindFlags
Source§fn bitxor(self, other: CpuBindFlags) -> CpuBindFlags
fn bitxor(self, other: CpuBindFlags) -> CpuBindFlags
Returns the left flags, but with all the right flags toggled.
Source§type Output = CpuBindFlags
type Output = CpuBindFlags
^ operator.Source§impl BitXorAssign for CpuBindFlags
impl BitXorAssign for CpuBindFlags
Source§fn bitxor_assign(&mut self, other: CpuBindFlags)
fn bitxor_assign(&mut self, other: CpuBindFlags)
Toggles the set of flags.
Source§impl Clone for CpuBindFlags
impl Clone for CpuBindFlags
Source§fn clone(&self) -> CpuBindFlags
fn clone(&self) -> CpuBindFlags
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CpuBindFlags
impl Debug for CpuBindFlags
Source§impl Extend<CpuBindFlags> for CpuBindFlags
impl Extend<CpuBindFlags> for CpuBindFlags
Source§fn extend<T: IntoIterator<Item = CpuBindFlags>>(&mut self, iterator: T)
fn extend<T: IntoIterator<Item = CpuBindFlags>>(&mut self, iterator: T)
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one)Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one)Source§impl FromIterator<CpuBindFlags> for CpuBindFlags
impl FromIterator<CpuBindFlags> for CpuBindFlags
Source§fn from_iter<T: IntoIterator<Item = CpuBindFlags>>(iterator: T) -> CpuBindFlags
fn from_iter<T: IntoIterator<Item = CpuBindFlags>>(iterator: T) -> CpuBindFlags
Source§impl Hash for CpuBindFlags
impl Hash for CpuBindFlags
Source§impl Not for CpuBindFlags
impl Not for CpuBindFlags
Source§fn not(self) -> CpuBindFlags
fn not(self) -> CpuBindFlags
Returns the complement of this set of flags.
Source§type Output = CpuBindFlags
type Output = CpuBindFlags
! operator.Source§impl Ord for CpuBindFlags
impl Ord for CpuBindFlags
Source§fn cmp(&self, other: &CpuBindFlags) -> Ordering
fn cmp(&self, other: &CpuBindFlags) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for CpuBindFlags
impl PartialEq for CpuBindFlags
Source§impl PartialOrd for CpuBindFlags
impl PartialOrd for CpuBindFlags
Source§impl Sub for CpuBindFlags
impl Sub for CpuBindFlags
Source§fn sub(self, other: CpuBindFlags) -> CpuBindFlags
fn sub(self, other: CpuBindFlags) -> CpuBindFlags
Returns the set difference of the two sets of flags.
Source§type Output = CpuBindFlags
type Output = CpuBindFlags
- operator.Source§impl SubAssign for CpuBindFlags
impl SubAssign for CpuBindFlags
Source§fn sub_assign(&mut self, other: CpuBindFlags)
fn sub_assign(&mut self, other: CpuBindFlags)
Disables all flags enabled in the set.