pub struct MediaDuration {
nanos: i64,
}Expand description
An interval between two MediaTime values. Resolution is
nanoseconds. Can be negative (e.g., when measuring drift).
Fields§
§nanos: i64Implementations§
Source§impl MediaDuration
impl MediaDuration
Sourcepub const fn from_nanos(nanos: i64) -> Self
pub const fn from_nanos(nanos: i64) -> Self
Construct from raw nanoseconds.
Sourcepub fn from_seconds(s: f64) -> Self
pub fn from_seconds(s: f64) -> Self
Construct from seconds.
Sourcepub const fn from_millis(ms: i64) -> Self
pub const fn from_millis(ms: i64) -> Self
Construct from milliseconds.
Sourcepub fn as_seconds(self) -> f64
pub fn as_seconds(self) -> f64
Seconds (f64).
Trait Implementations§
Source§impl Add<MediaDuration> for MediaTime
impl Add<MediaDuration> for MediaTime
Source§impl Add for MediaDuration
impl Add for MediaDuration
Source§impl Clone for MediaDuration
impl Clone for MediaDuration
Source§fn clone(&self) -> MediaDuration
fn clone(&self) -> MediaDuration
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MediaDuration
impl Debug for MediaDuration
Source§impl Default for MediaDuration
impl Default for MediaDuration
Source§fn default() -> MediaDuration
fn default() -> MediaDuration
Returns the “default value” for a type. Read more
Source§impl Hash for MediaDuration
impl Hash for MediaDuration
Source§impl Ord for MediaDuration
impl Ord for MediaDuration
Source§fn cmp(&self, other: &MediaDuration) -> Ordering
fn cmp(&self, other: &MediaDuration) -> Ordering
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 PartialEq for MediaDuration
impl PartialEq for MediaDuration
Source§fn eq(&self, other: &MediaDuration) -> bool
fn eq(&self, other: &MediaDuration) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialOrd for MediaDuration
impl PartialOrd for MediaDuration
Source§impl Sub<MediaDuration> for MediaTime
impl Sub<MediaDuration> for MediaTime
Source§impl Sub for MediaDuration
impl Sub for MediaDuration
impl Copy for MediaDuration
impl Eq for MediaDuration
impl StructuralPartialEq for MediaDuration
Auto Trait Implementations§
impl Freeze for MediaDuration
impl RefUnwindSafe for MediaDuration
impl Send for MediaDuration
impl Sync for MediaDuration
impl Unpin for MediaDuration
impl UnsafeUnpin for MediaDuration
impl UnwindSafe for MediaDuration
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