[−][src]Struct music_timer::time_signature::TimeSignature
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 signaturedenominator
- 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]
fn clone(&self) -> TimeSignature
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for TimeSignature
[src]
impl Debug for TimeSignature
[src]
impl Default for TimeSignature
[src]
fn default() -> TimeSignature
[src]
impl PartialEq<TimeSignature> for TimeSignature
[src]
Auto Trait Implementations
impl RefUnwindSafe for TimeSignature
impl Send for TimeSignature
impl Sync for TimeSignature
impl Unpin for TimeSignature
impl UnwindSafe for TimeSignature
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,
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<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
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.
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>,