Struct atopology::MACHINE_TOPOLOGY[][src]

pub struct MACHINE_TOPOLOGY { /* fields omitted */ }

A struct that contains all information about current machine we’re running on (discovered from ACPI Tables and cpuid).

Should have some of the following:

  • Cores, NUMA nodes, Memory regions
  • Interrupt routing (I/O APICs, overrides) (TODO)
  • PCIe root complexes (TODO)

Methods from Deref<Target = MachineInfo>

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 Deref for MACHINE_TOPOLOGY[src]

type Target = MachineInfo

The resulting type after dereferencing.

impl LazyStatic for MACHINE_TOPOLOGY[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.