pub struct Mhz(pub u32);Expand description
A clock frequency in megahertz.
Prints GHz with one decimal place at or above 1000 MHz (5.7 GHz,
3.0 GHz) and whole MHz below (800 MHz).
use sys_lib::Mhz;
assert_eq!(Mhz(5_700).to_string(), "5.7 GHz");
assert_eq!(Mhz(3_000).to_string(), "3.0 GHz");
assert_eq!(Mhz(800).to_string(), "800 MHz");Tuple Fields§
§0: u32Trait Implementations§
impl Copy for Mhz
impl Eq for Mhz
Source§impl Ord for Mhz
impl Ord for Mhz
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialOrd for Mhz
impl PartialOrd for Mhz
impl StructuralPartialEq for Mhz
Auto Trait Implementations§
impl Forget for Mhz
impl Freeze for Mhz
impl Move for Mhz
impl RefUnwindSafe for Mhz
impl Send for Mhz
impl Sync for Mhz
impl Unpin for Mhz
impl UnsafeUnpin for Mhz
impl UnwindSafe for Mhz
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