devela::_dep::raw_cpuid

Trait CpuIdReader

pub trait CpuIdReader: Clone {
    // Required method
    fn cpuid2(&self, eax: u32, ecx: u32) -> CpuIdResult;

    // Provided method
    fn cpuid1(&self, eax: u32) -> CpuIdResult { ... }
}
Available on crate feature dep_raw_cpuid only.
Expand description

Implements function to read/write cpuid. This allows to conveniently swap out the underlying cpuid implementation with one that returns data that is deterministic (for unit-testing).

Required Methods§

fn cpuid2(&self, eax: u32, ecx: u32) -> CpuIdResult

Provided Methods§

fn cpuid1(&self, eax: u32) -> CpuIdResult

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

§

impl CpuIdReader for CpuIdReaderNative

§

impl<F> CpuIdReader for F
where F: Fn(u32, u32) -> CpuIdResult + Clone,