raw_cpuid

Trait CpuIdReader

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

    // Provided method
    fn cpuid1(&self, eax: u32) -> CpuIdResult { ... }
}
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§

source

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

Provided Methods§

source

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§

source§

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