#[non_exhaustive]pub struct Topology {
pub packages: Vec<Package>,
pub cores: Vec<Core>,
}Expand description
Packages (sockets) and cores, sorted by id.
use sys_lib as sys;
let t = sys::cpu::topology();
let fast = t.cores.iter().filter(|c| c.kind == sys::cpu::CoreKind::Performance).count();
println!("{} cores, {fast} performance cores, hybrid: {}", t.cores.len(), sys::cpu::is_hybrid());Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.packages: Vec<Package>The packages.
cores: Vec<Core>The cores.
Trait Implementations§
impl Eq for Topology
impl StructuralPartialEq for Topology
Auto Trait Implementations§
impl Forget for Topology
impl Freeze for Topology
impl RefUnwindSafe for Topology
impl Send for Topology
impl Sync for Topology
impl Unpin for Topology
impl UnsafeUnpin for Topology
impl UnwindSafe for Topology
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