pub struct RationalRate { /* private fields */ }Expand description
A positive, normalized rational rate.
Implementations§
Source§impl RationalRate
impl RationalRate
Sourcepub fn new(numerator: u32, denominator: u32) -> Result<Self>
pub fn new(numerator: u32, denominator: u32) -> Result<Self>
Creates a reduced positive rate.
§Errors
Returns ErrorKind::InvalidArgument when either component is zero.
Sourcepub const fn denominator(self) -> u32
pub const fn denominator(self) -> u32
Returns the reduced denominator.
Trait Implementations§
Source§impl Clone for RationalRate
impl Clone for RationalRate
Source§fn clone(&self) -> RationalRate
fn clone(&self) -> RationalRate
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for RationalRate
Source§impl Debug for RationalRate
impl Debug for RationalRate
Source§impl Display for RationalRate
impl Display for RationalRate
impl Eq for RationalRate
Source§impl FromStr for RationalRate
impl FromStr for RationalRate
Source§impl Hash for RationalRate
impl Hash for RationalRate
Source§impl Ord for RationalRate
impl Ord for RationalRate
Source§fn cmp(&self, other: &RationalRate) -> Ordering
fn cmp(&self, other: &RationalRate) -> Ordering
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
Source§impl PartialEq for RationalRate
impl PartialEq for RationalRate
Source§fn eq(&self, other: &RationalRate) -> bool
fn eq(&self, other: &RationalRate) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialOrd for RationalRate
impl PartialOrd for RationalRate
impl StructuralPartialEq for RationalRate
Auto Trait Implementations§
impl Freeze for RationalRate
impl RefUnwindSafe for RationalRate
impl Send for RationalRate
impl Sync for RationalRate
impl Unpin for RationalRate
impl UnsafeUnpin for RationalRate
impl UnwindSafe for RationalRate
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