pub struct FrameRate { /* private fields */ }Expand description
A positive rational frame rate in reduced form, at most one frame per tick (120 000 frames per second).
Implementations§
Source§impl FrameRate
impl FrameRate
Sourcepub const fn new(num: u32, den: u32) -> Result<Self, FrameRateError>
pub const fn new(num: u32, den: u32) -> Result<Self, FrameRateError>
Creates and reduces a positive rate.
§Errors
Returns an error for zero components or sub-tick frame duration.
Sourcepub const fn denominator(self) -> u32
pub const fn denominator(self) -> u32
Reduced denominator.
Sourcepub fn frame_start(self, frame: i64) -> Option<MediaTime>
pub fn frame_start(self, frame: i64) -> Option<MediaTime>
Exact floored start of a signed frame index, or None when it lies
outside the i64 tick range.
Sourcepub fn frame_at_or_before(self, time: MediaTime) -> Option<i64>
pub fn frame_at_or_before(self, time: MediaTime) -> Option<i64>
Frame whose half-open interval contains time, or None when the
index does not fit in an i64.
Trait Implementations§
impl Copy for FrameRate
Source§impl<'de> Deserialize<'de> for FrameRate
impl<'de> Deserialize<'de> for FrameRate
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for FrameRate
impl StructuralPartialEq for FrameRate
Auto Trait Implementations§
impl Freeze for FrameRate
impl RefUnwindSafe for FrameRate
impl Send for FrameRate
impl Sync for FrameRate
impl Unpin for FrameRate
impl UnsafeUnpin for FrameRate
impl UnwindSafe for FrameRate
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