[][src]Struct music_timer::time_signature::TimeSignature

pub struct TimeSignature { /* fields omitted */ }

Data structure of numerator(upper) and denominator(lower) values of music time signature

Methods

impl TimeSignature[src]

pub fn new(numerator: u8, denominator: u8) -> TimeSignature[src]

Create new signature with the defined numerator(upper) and denominator(lower) values.

Arguments

  • numerator - The upper value of a time signature
  • denominator - The lower value of a time signature

Example

let time_signature = music_timer::time_signature::TimeSignature::new(4, 4);

pub fn is_valid(&self) -> bool[src]

Returns true if the time signature is valid. Current limitations of this crate recommend that denominator values should only be 2, 4, 8, 16 or 32. The numerator cannot be 0. It is your responsibility to create a valid TimeSignature.

pub fn get_numerator(&self) -> u8[src]

Get the top value of the time signature.

pub fn get_denominator(&self) -> u8[src]

Get the bottom value of the time signature.

pub fn as_tuple(&self) -> (u8, u8)[src]

Trait Implementations

impl Clone for TimeSignature[src]

impl Copy for TimeSignature[src]

impl Debug for TimeSignature[src]

impl Default for TimeSignature[src]

impl PartialEq<TimeSignature> for TimeSignature[src]

Auto Trait Implementations

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.