pub struct DataRate(/* private fields */);Expand description
Data rate in bits per second.
Implementations§
Source§impl DataRate
impl DataRate
Sourcepub const fn bits_per_second(bps: f64) -> Self
pub const fn bits_per_second(bps: f64) -> Self
Creates a new data rate from an f64 value in bits/s.
Sourcepub const fn kilobits_per_second(kbps: f64) -> Self
pub const fn kilobits_per_second(kbps: f64) -> Self
Creates a new data rate from an f64 value in kilobits/s.
Sourcepub const fn megabits_per_second(mbps: f64) -> Self
pub const fn megabits_per_second(mbps: f64) -> Self
Creates a new data rate from an f64 value in megabits/s.
Sourcepub const fn to_bits_per_second(&self) -> f64
pub const fn to_bits_per_second(&self) -> f64
Returns the value in bits/s.
Sourcepub const fn to_kilobits_per_second(&self) -> f64
pub const fn to_kilobits_per_second(&self) -> f64
Returns the value in kilobits/s.
Sourcepub const fn to_megabits_per_second(&self) -> f64
pub const fn to_megabits_per_second(&self) -> f64
Returns the value in megabits/s.
Trait Implementations§
Source§impl AddAssign for DataRate
impl AddAssign for DataRate
Source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
Performs the
+= operation. Read moreSource§impl PartialOrd for DataRate
impl PartialOrd for DataRate
Source§impl SubAssign for DataRate
impl SubAssign for DataRate
Source§fn sub_assign(&mut self, rhs: Self)
fn sub_assign(&mut self, rhs: Self)
Performs the
-= operation. Read moreimpl Copy for DataRate
impl StructuralPartialEq for DataRate
Auto Trait Implementations§
impl Freeze for DataRate
impl RefUnwindSafe for DataRate
impl Send for DataRate
impl Sync for DataRate
impl Unpin for DataRate
impl UnsafeUnpin for DataRate
impl UnwindSafe for DataRate
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