[−][src]Struct cue_sheet::parser::Time
Time representation of the format mm:ss:ff
.
Where mm = minutes, ss = seconds, ff = frames/sectors. There are 75 frames per second, 60 seconds per minute.
Methods
impl Time
[src]
pub fn new(minutes: i32, seconds: i8, frames: i8) -> Time
[src]
Create a new instance with the specified components.
pub fn to_string_2(&self) -> String
[src]
Format as `mm:ss' dropping truncating the remainding frames.
pub fn minutes(&self) -> i32
[src]
Returns the "minutes" component of this instance.
use cue_sheet::parser::Time; let time = Time::new(1, 2, 3); assert_eq!(time.minutes(), 1);
pub fn seconds(&self) -> i8
[src]
Returns the "seconds" component of this instance.
use cue_sheet::parser::Time; let time = Time::new(1, 2, 3); assert_eq!(time.seconds(), 2);
pub fn frames(&self) -> i8
[src]
Returns the "frames/sectors" component of this instance.
use cue_sheet::parser::Time; let time = Time::new(1, 2, 3); assert_eq!(time.frames(), 3);
pub fn total_minutes(&self) -> f64
[src]
Returns the total number of minutes represented by this instance.
use cue_sheet::parser::Time; let time = Time::new(1, 2, 3); assert_eq!(time.total_minutes(), 1.034); let time = Time::new(2, 30, 0); assert_eq!(time.total_minutes(), 2.5);
pub fn total_seconds(&self) -> f64
[src]
Returns the total number of seconds represented by this instance.
use cue_sheet::parser::Time; let time = Time::new(1, 2, 3); assert_eq!(time.total_seconds(), 62.04); let time = Time::new(2, 30, 0); assert_eq!(time.total_seconds(), 150.);
pub fn total_frames(&self) -> i64
[src]
Returns the total number of frames/sectors represented by this instance.
use cue_sheet::parser::Time; let time = Time::new(1, 2, 3); assert_eq!(time.total_frames(), 4653); let time = Time::new(2, 30, 5); assert_eq!(time.total_frames(), 11255);
pub fn from_frames(from: i64) -> Time
[src]
Create an instance for the specified number of frames/sectors.
use cue_sheet::parser::Time; let time = Time::from_frames(200); assert_eq!(time, Time::new(0, 2, 50));
Trait Implementations
impl Clone for Time
[src]
fn clone(&self) -> Time
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl PartialEq<Time> for Time
[src]
impl PartialOrd<Time> for Time
[src]
fn partial_cmp(&self, other: &Time) -> Option<Ordering>
[src]
#[must_use]
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests less than (for self
and other
) and is used by the <
operator. Read more
#[must_use]
fn le(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
#[must_use]
fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
#[must_use]
fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl Ord for Time
[src]
fn cmp(&self, other: &Time) -> Ordering
[src]
fn max(self, other: Self) -> Self
1.21.0[src]
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.21.0[src]
Compares and returns the minimum of two values. Read more
fn clamp(self, min: Self, max: Self) -> Self
[src]
clamp
)Returns max if self is greater than max, and min if self is less than min. Otherwise this will return self. Panics if min > max. Read more
impl Eq for Time
[src]
impl Hash for Time
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl Sub<Time> for Time
[src]
type Output = Time
The resulting type after applying the -
operator.
fn sub(self, rhs: Time) -> Self::Output
[src]
impl Debug for Time
[src]
impl Display for Time
[src]
impl FromStr for Time
[src]
Auto Trait Implementations
Blanket Implementations
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,