Struct symphonia_core::units::TimeBase [−][src]
A TimeBase
is the conversion factor between a TimeStamp
and real-world seconds.
Fields
numer: u32
The numerator.
denom: u32
The denominator.
Implementations
impl TimeBase
[src]
pub fn new(numer: u32, denom: u32) -> Self
[src]
Creates a new TimeBase
. Panics if either the numerator or denominator is 0.
pub fn calc_time(&self, ts: TimeStamp) -> Time
[src]
Accurately calculates a Time
using the TimeBase
and the provided TimeStamp
. On
overflow, the seconds field of Time
wraps.
pub fn calc_timestamp(&self, time: Time) -> TimeStamp
[src]
Accurately calculates a TimeStamp
from the given Time
using the TimeBase
as the
conversion factor. On overflow, the TimeStamp
wraps.
Trait Implementations
impl Clone for TimeBase
[src]
impl Copy for TimeBase
[src]
impl Debug for TimeBase
[src]
impl Default for TimeBase
[src]
impl PartialEq<TimeBase> for TimeBase
[src]
impl StructuralPartialEq for TimeBase
[src]
Auto Trait Implementations
impl RefUnwindSafe for TimeBase
impl Send for TimeBase
impl Sync for TimeBase
impl Unpin for TimeBase
impl UnwindSafe for TimeBase
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<F, T> IntoSample<T> for F where
T: FromSample<F>,
[src]
T: FromSample<F>,
pub fn into_sample(Self) -> T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,