pub struct TimeBase { /* private fields */ }Expand description
Seconds per tick, as a reduced fraction numerator / denominator.
TimeBase::new(1, 90000) is the 90 kHz MPEG clock; TimeBase::new(1001, 30000) ticks once per NTSC frame.
Implementations§
Source§impl TimeBase
impl TimeBase
Sourcepub const fn new(numerator: u32, denominator: u32) -> Result<Self, TimingError>
pub const fn new(numerator: u32, denominator: u32) -> Result<Self, TimingError>
numerator / denominator seconds per tick, reduced. Both must be
positive (TimingError::ZeroDenominator otherwise).
Sourcepub const fn hz(ticks_per_second: u32) -> Result<Self, TimingError>
pub const fn hz(ticks_per_second: u32) -> Result<Self, TimingError>
A clock of ticks_per_second ticks per second.
Sourcepub const fn denominator(self) -> u32
pub const fn denominator(self) -> u32
Denominator of seconds per tick.
Trait Implementations§
impl Copy for TimeBase
impl Eq for TimeBase
impl StructuralPartialEq for TimeBase
Auto Trait Implementations§
impl Freeze for TimeBase
impl RefUnwindSafe for TimeBase
impl Send for TimeBase
impl Sync for TimeBase
impl Unpin for TimeBase
impl UnsafeUnpin for TimeBase
impl UnwindSafe for TimeBase
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