[][src]Enum tonal::Length

#[repr(i32)]pub enum Length {
    Sixteenth,
    Eigth,
    Quarter,
    Half,
    Whole,
}

Represents the length of a musical note.

Variants

Sixteenth

A sixteenth of a whole note.

Eigth

An eigth of a whole note.

Quarter

A quarter of a whole note.

Half

A half of a whole note.

Whole

A whole note.

Implementations

impl Length[src]

pub fn duration(self, bpm: f64) -> Duration[src]

Calculates the time needed for a length in a ceratin BPM.

Examples

use tonal::*;
use std::time::Duration;

let bpm = 60.0;
let whole = Length::Whole;
assert_eq!(whole.duration(bpm), Duration::from_secs(4));

Trait Implementations

impl Clone for Length[src]

impl Copy for Length[src]

impl Debug for Length[src]

impl Eq for Length[src]

impl Hash for Length[src]

impl Ord for Length[src]

impl PartialEq<Length> for Length[src]

impl PartialOrd<Length> for Length[src]

impl StructuralEq for Length[src]

impl StructuralPartialEq for Length[src]

Auto Trait Implementations

impl RefUnwindSafe for Length

impl Send for Length

impl Sync for Length

impl Unpin for Length

impl UnwindSafe for Length

Blanket Implementations

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

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

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

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

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

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

type Owned = T

The resulting type after obtaining ownership.

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.