CpuidTrait

Trait CpuidTrait 

Source
pub trait CpuidTrait {
    // Required methods
    fn get(&self, key: &CpuidKey) -> Option<&CpuidEntry>;
    fn get_mut(&mut self, key: &CpuidKey) -> Option<&mut CpuidEntry>;

    // Provided methods
    fn vendor_id(&self) -> Option<[u8; 12]> { ... }
    fn apply_brand_string(
        &mut self,
        brand_string: &[u8; 48],
    ) -> Result<(), MissingBrandStringLeaves> { ... }
}
Expand description

Trait defining shared behaviour between CPUID structures.

Required Methods§

Source

fn get(&self, key: &CpuidKey) -> Option<&CpuidEntry>

Gets a given sub-leaf.

Source

fn get_mut(&mut self, key: &CpuidKey) -> Option<&mut CpuidEntry>

Gets a given sub-leaf.

Provided Methods§

Source

fn vendor_id(&self) -> Option<[u8; 12]>

Returns the CPUID manufacturers ID (e.g. GenuineIntel or AuthenticAMD) or None if it cannot be found in CPUID (e.g. leaf 0x0 is missing).

Source

fn apply_brand_string( &mut self, brand_string: &[u8; 48], ) -> Result<(), MissingBrandStringLeaves>

Applies a given brand string to CPUID.

§Errors

When any of the leaves 0x80000002, 0x80000003 or 0x80000004 are not present.

Implementations on Foreign Types§

Source§

impl CpuidTrait for CpuId

Source§

fn get(&self, _: &CpuidKey) -> Option<&CpuidEntry>

Gets a given sub-leaf.

Source§

fn get_mut(&mut self, _: &CpuidKey) -> Option<&mut CpuidEntry>

Gets a given sub-leaf.

Implementors§