pub struct SmpteTime { /* private fields */ }Expand description
A timestamp encoding an SMPTE time of the day.
Enforces several guarantees:
houris inside [0,23]minuteis inside [0,59]secondis inside [0,59]frameis inside [0,fps[subframeis inside [0,99]
Implementations§
Source§impl SmpteTime
impl SmpteTime
Sourcepub fn new(
hour: u8,
minute: u8,
second: u8,
frame: u8,
subframe: u8,
fps: Fps,
) -> Option<SmpteTime>
pub fn new( hour: u8, minute: u8, second: u8, frame: u8, subframe: u8, fps: Fps, ) -> Option<SmpteTime>
Create a new SMPTE timestamp with the given information.
Sourcepub fn frame(&self) -> u8
pub fn frame(&self) -> u8
Get the frame component of this timestamp.
The meaning of this value depends on the value of fps.
Sourcepub fn subframe(&self) -> u8
pub fn subframe(&self) -> u8
Get the subframe component of this timestamp (hundredths of a frame).
Sourcepub fn second_f32(&self) -> f32
pub fn second_f32(&self) -> f32
Convert the second + frame + subframe components of this timestamp into a single floating-point number of seconds. Note that this does not include the hour and minute components.
Trait Implementations§
impl Copy for SmpteTime
impl Eq for SmpteTime
impl StructuralPartialEq for SmpteTime
Auto Trait Implementations§
impl Freeze for SmpteTime
impl RefUnwindSafe for SmpteTime
impl Send for SmpteTime
impl Sync for SmpteTime
impl Unpin for SmpteTime
impl UnwindSafe for SmpteTime
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more