pub struct Timecode { /* private fields */ }Implementations§
Source§impl Timecode
impl Timecode
pub fn new( h: u8, m: u8, s: u8, f: u8, rate: FrameRate, ) -> Result<Self, TimecodeError>
pub const fn from_frames(total_frames: i64, rate: FrameRate) -> Self
pub fn from_seconds(seconds: f64, rate: FrameRate) -> Self
pub fn from_milliseconds(ms: f64, rate: FrameRate) -> Self
pub fn parse(s: &str, rate: FrameRate) -> Result<Self, TimecodeError>
pub fn validate(s: &str, rate: FrameRate) -> bool
pub fn hours(&self) -> u8
pub fn minutes(&self) -> u8
pub fn seconds(&self) -> u8
pub fn frames(&self) -> u8
pub fn components(&self) -> (u8, u8, u8, u8)
pub const fn total_frames(&self) -> i64
pub const fn rate(&self) -> FrameRate
pub fn to_seconds(&self) -> f64
pub fn to_milliseconds(&self) -> f64
pub fn to_rational(&self) -> (i64, Rational)
pub fn convert_to(&self, target_rate: FrameRate) -> Self
pub fn frame_diff(&self, other: &Self) -> Result<i64, TimecodeError>
Trait Implementations§
Source§impl PartialOrd for Timecode
impl PartialOrd for Timecode
impl Copy for Timecode
impl Eq for Timecode
impl StructuralPartialEq for Timecode
Auto Trait Implementations§
impl Freeze for Timecode
impl RefUnwindSafe for Timecode
impl Send for Timecode
impl Sync for Timecode
impl Unpin for Timecode
impl UnsafeUnpin for Timecode
impl UnwindSafe for Timecode
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