pub struct MeasureLength {
pub numerator: u32,
pub denominator: u32,
}Expand description
Authored length of a measure that differs from its time signature: a pickup (anacrusis), an
incomplete final bar, or any irregular bar, as MuseScore’s measure len="1/4". The value is a
fraction of a whole note, so 1/4 lasts one quarter-note beat.
Fields§
§numerator: u32§denominator: u32Implementations§
Source§impl MeasureLength
impl MeasureLength
Sourcepub fn beats(&self) -> Option<f64>
pub fn beats(&self) -> Option<f64>
Length in quarter-note beats, or None for a zero, non-finite, or oversized fraction.
Sourcepub fn from_beats(beats: f64) -> Option<Self>
pub fn from_beats(beats: f64) -> Option<Self>
Fraction for a length in quarter-note beats, exact for binary, triplet, quintuplet
and septuplet subdivisions; None for a zero, negative, or oversized length.
Sourcepub fn from_ticks(ticks: u32, divisions: u32) -> Option<Self>
pub fn from_ticks(ticks: u32, divisions: u32) -> Option<Self>
Exact fraction for ticks at divisions ticks per quarter note, in lowest terms.
Trait Implementations§
Source§impl Clone for MeasureLength
impl Clone for MeasureLength
impl Copy for MeasureLength
Source§impl Debug for MeasureLength
impl Debug for MeasureLength
Source§impl<'de> Deserialize<'de> for MeasureLength
impl<'de> Deserialize<'de> for MeasureLength
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for MeasureLength
Source§impl PartialEq for MeasureLength
impl PartialEq for MeasureLength
Source§impl Serialize for MeasureLength
impl Serialize for MeasureLength
impl StructuralPartialEq for MeasureLength
Auto Trait Implementations§
impl Freeze for MeasureLength
impl RefUnwindSafe for MeasureLength
impl Send for MeasureLength
impl Sync for MeasureLength
impl Unpin for MeasureLength
impl UnsafeUnpin for MeasureLength
impl UnwindSafe for MeasureLength
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more