pub struct MediaTime(pub i64);Expand description
A signed position or duration in timeline ticks (120 000 per second).
A time read from JSON is at most MAX_SERIALIZED_TICKS either way.
Tuple Fields§
§0: i64Implementations§
Source§impl MediaTime
impl MediaTime
Sourcepub const fn from_ticks(ticks: i64) -> Self
pub const fn from_ticks(ticks: i64) -> Self
Creates a value from ticks.
Sourcepub const fn presentation_deadline(self, slack: Self) -> Self
pub const fn presentation_deadline(self, slack: Self) -> Self
The latest timestamp a decoded frame of a stream whose
presentation_slack is slack may carry and still be the frame
shown at this source time. The frame shown is the last one at or
before it.
Sourcepub const fn from_seconds(seconds: i64) -> Self
pub const fn from_seconds(seconds: i64) -> Self
Creates a value from whole seconds, saturating at the i64 bounds.
Sourcepub const fn checked_add(self, other: Self) -> Option<Self>
pub const fn checked_add(self, other: Self) -> Option<Self>
Checked addition.
Sourcepub const fn checked_sub(self, other: Self) -> Option<Self>
pub const fn checked_sub(self, other: Self) -> Option<Self>
Checked subtraction.
Trait Implementations§
impl Copy for MediaTime
Source§impl<'de> Deserialize<'de> for MediaTime
impl<'de> Deserialize<'de> for MediaTime
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 MediaTime
Source§impl Ord for MediaTime
impl Ord for MediaTime
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
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialOrd for MediaTime
impl PartialOrd for MediaTime
impl StructuralPartialEq for MediaTime
Auto Trait Implementations§
impl Freeze for MediaTime
impl RefUnwindSafe for MediaTime
impl Send for MediaTime
impl Sync for MediaTime
impl Unpin for MediaTime
impl UnsafeUnpin for MediaTime
impl UnwindSafe for MediaTime
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