pub struct Rate { /* private fields */ }Expand description
An exact positive video frame rate, in frames per second.
Implementations§
Source§impl Rate
impl Rate
Sourcepub fn new(numerator: u32, denominator: u32) -> Result<Self, RateError>
pub fn new(numerator: u32, denominator: u32) -> Result<Self, RateError>
Construct an exact rate from a numerator and denominator.
Sourcepub fn from_f64(value: f64) -> Result<Self, RateError>
pub fn from_f64(value: f64) -> Result<Self, RateError>
Approximate a finite catalog rate using 32-bit rational components.
Sourcepub fn denominator(self) -> u32
pub fn denominator(self) -> u32
The frames-per-second denominator.
Trait Implementations§
impl Copy for Rate
impl Eq for Rate
Source§impl Ord for Rate
impl Ord for Rate
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 Rate
impl PartialOrd for Rate
impl StructuralPartialEq for Rate
Auto Trait Implementations§
impl Freeze for Rate
impl RefUnwindSafe for Rate
impl Send for Rate
impl Sync for Rate
impl Unpin for Rate
impl UnsafeUnpin 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