Skip to main content

CounterInterface

Trait CounterInterface 

Source
pub trait CounterInterface {
    // Required methods
    fn counter_value(&self) -> u64;
    fn frequency(&self) -> u32;
}
Expand description

Interface for accessing common counter registers.

Required Methods§

Source

fn counter_value(&self) -> u64

Returns the up-counter value.

Source

fn frequency(&self) -> u32

Returns the counter frequency in Hz.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§

Source§

impl CounterInterface for MmioCounter<'_>

Source§

impl CounterInterface for PhysicalCounter

Available on AArch64 or crate feature fakes only.
Source§

impl CounterInterface for VirtualCounter

Available on AArch64 or crate feature fakes only.