pub enum ResolvedCpuPlacement {
NumaNode {
id: NumaNodeId,
cpus: CpuSet,
},
AllAllowed {
cpus: CpuSet,
},
}Expand description
Concrete CPU placement resolved for a managed domain or declared by an external domain.
§Examples
use tenferro_cpu::{CpuId, CpuSet, ResolvedCpuPlacement};
let placement = ResolvedCpuPlacement::AllAllowed {
cpus: CpuSet::new([CpuId::new(0)])?,
};
assert_eq!(placement.cpus().len(), 1);Variants§
NumaNode
A concrete OS NUMA-node placement.
Fields
§
id: NumaNodeIdThe sparse OS NUMA node ID.
AllAllowed
A resolved or declared complete process-affinity CPU set.
Implementations§
Source§impl ResolvedCpuPlacement
impl ResolvedCpuPlacement
Sourcepub fn cpus(&self) -> &CpuSet
pub fn cpus(&self) -> &CpuSet
Return the concrete logical CPU set resolved or declared for this placement.
§Examples
use tenferro_cpu::{CpuId, CpuSet, ResolvedCpuPlacement};
let placement = ResolvedCpuPlacement::AllAllowed {
cpus: CpuSet::new([CpuId::new(1), CpuId::new(2)])?,
};
assert_eq!(placement.cpus().as_usize_vec(), vec![1, 2]);Sourcepub fn node_id(&self) -> Option<NumaNodeId>
pub fn node_id(&self) -> Option<NumaNodeId>
Return the OS NUMA node ID for a node placement.
§Examples
use tenferro_cpu::{CpuId, CpuSet, NumaNodeId, ResolvedCpuPlacement};
let placement = ResolvedCpuPlacement::NumaNode {
id: NumaNodeId::new(7),
cpus: CpuSet::new([CpuId::new(3)])?,
};
assert_eq!(placement.node_id(), Some(NumaNodeId::new(7)));Trait Implementations§
Source§impl Clone for ResolvedCpuPlacement
impl Clone for ResolvedCpuPlacement
Source§fn clone(&self) -> ResolvedCpuPlacement
fn clone(&self) -> ResolvedCpuPlacement
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ResolvedCpuPlacement
impl Debug for ResolvedCpuPlacement
Source§impl PartialEq for ResolvedCpuPlacement
impl PartialEq for ResolvedCpuPlacement
Source§fn eq(&self, other: &ResolvedCpuPlacement) -> bool
fn eq(&self, other: &ResolvedCpuPlacement) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for ResolvedCpuPlacement
impl StructuralPartialEq for ResolvedCpuPlacement
Auto Trait Implementations§
impl Freeze for ResolvedCpuPlacement
impl RefUnwindSafe for ResolvedCpuPlacement
impl Send for ResolvedCpuPlacement
impl Sync for ResolvedCpuPlacement
impl Unpin for ResolvedCpuPlacement
impl UnsafeUnpin for ResolvedCpuPlacement
impl UnwindSafe for ResolvedCpuPlacement
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,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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