pub struct Timestamp(pub u64);Expand description
A time point in microseconds from the start of the media.
Microsecond precision matches FFmpeg’s internal timestamp resolution, avoiding precision loss during conversion.
Tuple Fields§
§0: u64Implementations§
Source§impl Timestamp
impl Timestamp
Sourcepub fn from_millis(ms: u64) -> Self
pub fn from_millis(ms: u64) -> Self
Create from milliseconds.
Sourcepub fn from_micros(us: u64) -> Self
pub fn from_micros(us: u64) -> Self
Create from microseconds.
Sourcepub fn from_seconds(s: f64) -> Self
pub fn from_seconds(s: f64) -> Self
Create from seconds (floating point).
Sourcepub fn as_seconds(&self) -> f64
pub fn as_seconds(&self) -> f64
Get the value in seconds (floating point).
Sourcepub fn as_duration(&self) -> Duration
pub fn as_duration(&self) -> Duration
Convert to a Duration.
Sourcepub fn to_ffmpeg_time(&self) -> String
pub fn to_ffmpeg_time(&self) -> String
Format as “HH:MM:SS.mmm” (FFmpeg-compatible).
Trait Implementations§
impl Copy for Timestamp
Source§impl<'de> Deserialize<'de> for Timestamp
impl<'de> Deserialize<'de> for Timestamp
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 Timestamp
Source§impl Ord for Timestamp
impl Ord for Timestamp
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
Source§impl PartialOrd for Timestamp
impl PartialOrd for Timestamp
impl StructuralPartialEq for Timestamp
Auto Trait Implementations§
impl Freeze for Timestamp
impl RefUnwindSafe for Timestamp
impl Send for Timestamp
impl Sync for Timestamp
impl Unpin for Timestamp
impl UnsafeUnpin for Timestamp
impl UnwindSafe for Timestamp
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