pub struct TimeRange {
pub start: Timestamp,
pub end: Timestamp,
}Expand description
A time range within a media file.
Fields§
§start: TimestampStart of the range.
end: TimestampEnd of the range.
Implementations§
Source§impl TimeRange
impl TimeRange
Sourcepub fn from_millis(start_ms: u64, end_ms: u64) -> Self
pub fn from_millis(start_ms: u64, end_ms: u64) -> Self
Create from millisecond values.
Sourcepub fn from_seconds(start: f64, end: f64) -> Self
pub fn from_seconds(start: f64, end: f64) -> Self
Create from second values.
Sourcepub fn duration_ms(&self) -> u64
pub fn duration_ms(&self) -> u64
Duration of this range in milliseconds.
Sourcepub fn merge(&self, other: &TimeRange) -> Option<TimeRange>
pub fn merge(&self, other: &TimeRange) -> Option<TimeRange>
Merge two overlapping ranges into one, if they overlap.
Trait Implementations§
impl Copy for TimeRange
Source§impl<'de> Deserialize<'de> for TimeRange
impl<'de> Deserialize<'de> for TimeRange
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 TimeRange
impl StructuralPartialEq for TimeRange
Auto Trait Implementations§
impl Freeze for TimeRange
impl RefUnwindSafe for TimeRange
impl Send for TimeRange
impl Sync for TimeRange
impl Unpin for TimeRange
impl UnsafeUnpin for TimeRange
impl UnwindSafe for TimeRange
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