pub struct Hertz(pub c_ulong);
Expand description
The frequency unit.
Represents a frequency in hertz, wrapping a c_ulong
value.
§Examples
use kernel::clk::Hertz;
let hz = 1_000_000_000;
let rate = Hertz(hz);
assert_eq!(rate.as_hz(), hz);
assert_eq!(rate, Hertz(hz));
assert_eq!(rate, Hertz::from_khz(hz / 1_000));
assert_eq!(rate, Hertz::from_mhz(hz / 1_000_000));
assert_eq!(rate, Hertz::from_ghz(hz / 1_000_000_000));
Tuple Fields§
§0: c_ulong
Implementations§
Trait Implementations§
impl Copy for Hertz
impl Eq for Hertz
impl StructuralPartialEq for Hertz
Auto Trait Implementations§
impl Freeze for Hertz
impl RefUnwindSafe for Hertz
impl Send for Hertz
impl Sync for Hertz
impl Unpin for Hertz
impl UnwindSafe for Hertz
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more