Struct symphonia_core::units::Time

source ·
pub struct Time {
    pub seconds: u64,
    pub frac: f64,
}
Expand description

Time represents a duration of time in seconds, or the number of seconds since an arbitrary epoch. Time is stored as an integer number of seconds plus any remaining fraction of a second as a floating point value.

Fields§

§seconds: u64§frac: f64

Implementations§

source§

impl Time

source

pub fn new(seconds: u64, frac: f64) -> Self

source

pub fn from_ss(s: u8, ns: u32) -> Option<Time>

source

pub fn from_mmss(m: u8, s: u8, ns: u32) -> Option<Time>

source

pub fn from_hhmmss(h: u32, m: u8, s: u8, ns: u32) -> Option<Time>

Trait Implementations§

source§

impl Clone for Time

source§

fn clone(&self) -> Time

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Time

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for Time

source§

fn default() -> Time

Returns the “default value” for a type. Read more
source§

impl From<Duration> for Time

source§

fn from(duration: Duration) -> Self

Converts to this type from the input type.
source§

impl From<Time> for Duration

source§

fn from(time: Time) -> Self

Converts to this type from the input type.
source§

impl From<f32> for Time

source§

fn from(seconds: f32) -> Self

Converts to this type from the input type.
source§

impl From<f64> for Time

source§

fn from(seconds: f64) -> Self

Converts to this type from the input type.
source§

impl From<u16> for Time

source§

fn from(seconds: u16) -> Self

Converts to this type from the input type.
source§

impl From<u32> for Time

source§

fn from(seconds: u32) -> Self

Converts to this type from the input type.
source§

impl From<u64> for Time

source§

fn from(seconds: u64) -> Self

Converts to this type from the input type.
source§

impl From<u8> for Time

source§

fn from(seconds: u8) -> Self

Converts to this type from the input type.
source§

impl PartialEq for Time

source§

fn eq(&self, other: &Time) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for Time

source§

fn partial_cmp(&self, other: &Time) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl Copy for Time

source§

impl StructuralPartialEq for Time

Auto Trait Implementations§

§

impl RefUnwindSafe for Time

§

impl Send for Time

§

impl Sync for Time

§

impl Unpin for Time

§

impl UnwindSafe for Time

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<F, T> IntoSample<T> for F
where T: FromSample<F>,

source§

fn into_sample(self) -> T

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.