Skip to main content

Cpuid

Trait Cpuid 

Source
pub trait Cpuid {
    // Required method
    fn read_raw(&self, leaf: u32, subleaf: u32) -> CpuidRawResult;

    // Provided methods
    fn supports<const LEAF: u32, const SUBLEAF: u32, const REG: u8, Layout: LayoutOver<u32>>(
        &self,
        _cpuid: CpuidValue<LEAF, SUBLEAF, REG, Layout>,
    ) -> bool { ... }
    fn read<const LEAF: u32, const SUBLEAF: u32, const REG: u8, Layout: LayoutOver<u32>>(
        &self,
        _value: CpuidValue<LEAF, SUBLEAF, REG, Layout>,
    ) -> Layout { ... }
    fn try_read<const LEAF: u32, const SUBLEAF: u32, const REG: u8, Layout: LayoutOver<u32>>(
        &self,
        value: CpuidValue<LEAF, SUBLEAF, REG, Layout>,
    ) -> Option<Layout> { ... }
}
Expand description

An abstracted means of reading CPUID values.

Required Methods§

Source

fn read_raw(&self, leaf: u32, subleaf: u32) -> CpuidRawResult

Returns the CPUID values for a given leaf and subleaf.

Provided Methods§

Source

fn supports<const LEAF: u32, const SUBLEAF: u32, const REG: u8, Layout: LayoutOver<u32>>( &self, _cpuid: CpuidValue<LEAF, SUBLEAF, REG, Layout>, ) -> bool

Whether a CPUID leaf is supported, as associated with the provided Cpuid marker.

Source

fn read<const LEAF: u32, const SUBLEAF: u32, const REG: u8, Layout: LayoutOver<u32>>( &self, _value: CpuidValue<LEAF, SUBLEAF, REG, Layout>, ) -> Layout

Reads the particular CPUID value.

Source

fn try_read<const LEAF: u32, const SUBLEAF: u32, const REG: u8, Layout: LayoutOver<u32>>( &self, value: CpuidValue<LEAF, SUBLEAF, REG, Layout>, ) -> Option<Layout>

Reads the particular CPUID value if supported, returning None otherwise.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<C: Cpuid> Cpuid for &C

Source§

fn read_raw(&self, leaf: u32, subleaf: u32) -> CpuidRawResult

Implementors§