[][src]Struct alass_core::TimePoint

pub struct TimePoint(_);

Represents a timepoint in your own metric.

A timepoint is internally represented by an integer (because the align algorithm needs discrete time steps). You will have to choose your own metric: for example 1i64 means 2ms. The internal algorithm does not use any non-user given TimePoints (so its interpretation is up to you).

This is the reason this library works with TimePoint and TimeDelta: to enforce an absolute and delta relationship an a own metric.

The only way to create a new TimePoint is with TimePoint::from({i64}).

use alass_core::TimePoint;

let p = TimePoint::from(10);

// to get that i64 again
let i1: i64 = p.into();
let i2 = i64::from(p);

Methods

impl TimePoint[src]

pub fn as_f32(self) -> f32[src]

Returns a f32 for the given time point.

pub fn as_f64(self) -> f64[src]

Returns a f32 for the given time point.

pub fn as_i64(self) -> i64[src]

Returns a i64 for the given time point.

Trait Implementations

impl From<i64> for TimePoint[src]

impl From<TimePoint> for i64[src]

impl Clone for TimePoint[src]

impl Copy for TimePoint[src]

impl Eq for TimePoint[src]

impl Ord for TimePoint[src]

impl PartialEq<TimePoint> for TimePoint[src]

impl PartialOrd<TimePoint> for TimePoint[src]

impl Display for TimePoint[src]

impl Debug for TimePoint[src]

impl Sub<TimePoint> for TimePoint[src]

type Output = TimeDelta

The resulting type after applying the - operator.

impl Sub<TimeDelta> for TimePoint[src]

type Output = TimePoint

The resulting type after applying the - operator.

impl Add<TimeDelta> for TimePoint[src]

type Output = TimePoint

The resulting type after applying the + operator.

impl AddAssign<TimeDelta> for TimePoint[src]

impl SubAssign<TimeDelta> for TimePoint[src]

impl Hash for TimePoint[src]

Auto Trait Implementations

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]