Struct atopology::MachineInfo[][src]

pub struct MachineInfo {
    pub threads: Vec<Thread>,
    // some fields omitted
}

Contains a condensed and filtered version of all data queried from ACPI and CPUID.

Fields

threads: Vec<Thread>

All hardware threads in the system, indexed by GlobalThreadId.

Implementations

impl MachineInfo[src]

pub fn current_thread(&'static self) -> &'static Thread[src]

Returns the current thread we’re running on.

Notes

Uses cpuid to determine the current APIC ID, then uses the id to find the corresponding thread.

This is not an incredibly fast function since cpuid will clobber your registers unnecessarily. Ideally, call this once then cache.

You also need to ensure that execution is not migrated to another core during execution of current_thread.

pub fn num_threads(&self) -> usize[src]

Return the amount of threads in the system.

pub fn threads(&'static self) -> impl Iterator<Item = &Thread>[src]

Return iterator over all threads in the system.

pub fn num_cores(&self) -> usize[src]

Return the amount of cores in the system.

pub fn cores(&'static self) -> impl Iterator<Item = &Core>[src]

Return iterator over all cores in the system.

pub fn num_packages(&self) -> usize[src]

Return the amount of packages in the system.

pub fn packages(&'static self) -> impl Iterator<Item = &Package>[src]

Return iterator over all packages in the system.

pub fn nodes(&'static self) -> impl Iterator<Item = &Node>[src]

Return iterator over all NUMA nodes in the system.

pub fn num_nodes(&self) -> usize[src]

Return the amount of NUMA nodes in the system.

pub fn io_apics(&'static self) -> impl Iterator<Item = &IoApic>[src]

Return an iterator over all I/O APICs in the system.

Trait Implementations

impl Debug for MachineInfo[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.