pub struct CpuNode { /* private fields */ }Expand description
One usable OS NUMA node and its process-allowed logical CPUs.
§Examples
use tenferro_cpu::{CpuId, CpuNode, CpuSet, NumaNodeId};
let node = CpuNode::new(NumaNodeId::new(2), CpuSet::new([CpuId::new(8)])?);
assert_eq!(node.id(), NumaNodeId::new(2));Implementations§
Source§impl CpuNode
impl CpuNode
Sourcepub fn new(id: NumaNodeId, cpus: CpuSet) -> Self
pub fn new(id: NumaNodeId, cpus: CpuSet) -> Self
Construct a usable NUMA node description.
§Examples
use tenferro_cpu::{CpuId, CpuNode, CpuSet, NumaNodeId};
let node = CpuNode::new(NumaNodeId::new(7), CpuSet::new([CpuId::new(12)])?);
assert_eq!(node.id(), NumaNodeId::new(7));Sourcepub fn id(&self) -> NumaNodeId
pub fn id(&self) -> NumaNodeId
Return the sparse operating-system NUMA node ID.
§Examples
use tenferro_cpu::{CpuId, CpuNode, CpuSet, NumaNodeId};
let node = CpuNode::new(NumaNodeId::new(3), CpuSet::new([CpuId::new(0)])?);
assert_eq!(node.id().as_usize(), 3);Trait Implementations§
impl Eq for CpuNode
impl StructuralPartialEq for CpuNode
Auto Trait Implementations§
impl Freeze for CpuNode
impl RefUnwindSafe for CpuNode
impl Send for CpuNode
impl Sync for CpuNode
impl Unpin for CpuNode
impl UnsafeUnpin for CpuNode
impl UnwindSafe for CpuNode
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