[][src]Enum nom_midi::KeySignature

pub enum KeySignature {
    CMajor,
    GMajor,
    DMajor,
    AMajor,
    EMajor,
    BMajor,
    FSharpMajor,
    CSharpMajor,
    FMajor,
    BFlatMajor,
    EFlatMajor,
    AFlatMajor,
    DFlatMajor,
    GFlatMajor,
    CFlatMajor,
    AMinor,
    EMinor,
    BMinor,
    FSharpMinor,
    CSharpMinor,
    GSharpMinor,
    DSharpMinor,
    ASharpMinor,
    DMinor,
    GMinor,
    CMinor,
    FMinor,
    BFlatMinor,
    EFlatMinor,
    AFlatMinor,
}

All possible Key Signatures

Variants

CMajorGMajorDMajorAMajorEMajorBMajorFSharpMajorCSharpMajorFMajorBFlatMajorEFlatMajorAFlatMajorDFlatMajorGFlatMajorCFlatMajorAMinorEMinorBMinorFSharpMinorCSharpMinorGSharpMinorDSharpMinorASharpMinorDMinorGMinorCMinorFMinorBFlatMinorEFlatMinorAFlatMinor

Methods

impl KeySignature[src]

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

Count the number of sharps or flats

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

Whether there are sharps or flats

Panics

Panics if there are no sharps or flats. Use count to check this first to avoid

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

Get a tuple of the number of sharps/flats, and a bool that is true for sharps, false for flats.

The second value is not specified (could be anything) when the first is 0.

Trait Implementations

impl PartialEq<KeySignature> for KeySignature[src]

#[must_use] fn ne(&self, other: &Rhs) -> bool1.0.0[src]

This method tests for !=.

impl Clone for KeySignature[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Copy for KeySignature[src]

impl Debug for KeySignature[src]

Auto Trait Implementations

Blanket Implementations

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

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

type Owned = T

The resulting type after obtaining ownership.

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

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.

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

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

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