pub struct Rate { /* private fields */ }
Expand description
A frequency, measured by some rational fraction of seconds.
Implementations§
source§impl Rate
impl Rate
sourcepub fn per_second(numerator: u32, denominator: u32) -> Rate
pub fn per_second(numerator: u32, denominator: u32) -> Rate
Creates a new Rate with the given numerator and denominator. The denominator is seconds.
PANICS if the numerator or denominator are zero, or are greater than one billion!
sourcepub const fn per_second_nonzero(
numerator: NonZeroU32,
denominator: NonZeroU32
) -> Rate
pub const fn per_second_nonzero( numerator: NonZeroU32, denominator: NonZeroU32 ) -> Rate
Creates a new Rate with the given numerator and denominator. The denominator is seconds.
YOU must ensure that the numerator and denominator do not exceed one billion.
Trait Implementations§
source§impl PartialEq<Rate> for Rate
impl PartialEq<Rate> for Rate
impl Copy for Rate
Auto Trait Implementations§
impl RefUnwindSafe for Rate
impl Send for Rate
impl Sync for Rate
impl Unpin for Rate
impl UnwindSafe for Rate
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