CoreInfo

Struct CoreInfo 

Source
pub struct CoreInfo {
    pub id: usize,
    pub socket_id: usize,
    pub core_type: CoreType,
    pub logical_processor_ids: Vec<usize>,
    pub l1_instruction_cache: Option<CacheInfo>,
    pub l1_data_cache: Option<CacheInfo>,
    pub l2_cache: Option<CacheInfo>,
}
Expand description

Represents detailed information about a single physical CPU core.

This structure provides data about a core’s identification, its type (especially in hybrid architectures), the logical processors (hardware threads) it hosts, and information about its dedicated or closely associated caches (L1, L2).

Fields§

§id: usize

A unique identifier for this physical core across the entire system (all sockets).

This ID is assigned by the library and may not directly correspond to OS-level core IDs.

§socket_id: usize

The identifier of the CPU socket (physical package) to which this core belongs.

§core_type: CoreType

The architectural type of this core (e.g., Performance or Efficiency).

This is particularly relevant for hybrid CPUs. For non-hybrid CPUs, this defaults to CoreType::Performance.

§logical_processor_ids: Vec<usize>

A list of OS-specific identifiers for the logical processors (hardware threads) that are executed on this physical core.

For cores without Hyper-Threading/SMT, this will typically contain one ID. For cores with Hyper-Threading/SMT, it will contain multiple IDs (e.g., two for HT). These IDs can be used for setting thread affinity.

§l1_instruction_cache: Option<CacheInfo>

Information about the L1 instruction cache specific to this core, if available and detected.

L1 instruction caches (L1i) store frequently executed instructions.

§l1_data_cache: Option<CacheInfo>

Information about the L1 data cache specific to this core, if available and detected.

L1 data caches (L1d) store frequently accessed data.

§l2_cache: Option<CacheInfo>

Information about the L2 cache associated with this core, if available and detected.

L2 caches are generally larger and slower than L1 caches. They might be exclusive to this core or shared with a small cluster of other cores, depending on the CPU architecture.

Trait Implementations§

Source§

impl Clone for CoreInfo

Source§

fn clone(&self) -> CoreInfo

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for CoreInfo

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.