Struct ukebox::note::Note[][src]

pub struct Note {
    pub pitch_class: PitchClass,
    // some fields omitted
}

A note such a C, C# and so on.

Fields

pitch_class: PitchClass

Implementations

impl Note[src]

pub fn new(pitch_class: PitchClass, staff_position: StaffPosition) -> Self[src]

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

Return true if this note is a “white note”, i.e. a note represented by a white key on the piano (i.e. the note is part of the C major scale).

Trait Implementations

impl Add<Interval> for Note[src]

type Output = Self

The resulting type after applying the + operator.

fn add(self, interval: Interval) -> Self[src]

Get the next note when adding interval to the current note.

impl Add<u8> for Note[src]

type Output = Self

The resulting type after applying the + operator.

impl Clone for Note[src]

impl Copy for Note[src]

impl Debug for Note[src]

impl Display for Note[src]

impl Eq for Note[src]

impl From<PitchClass> for Note[src]

fn from(pitch_class: PitchClass) -> Self[src]

Convert a pitch class into a note. For notes that can be sharp or flat use the sharp version.

impl FromStr for Note[src]

type Err = ParseNoteError

The associated error which can be returned from parsing.

impl Ord for Note[src]

impl PartialEq<Note> for Note[src]

fn eq(&self, other: &Self) -> bool[src]

Treat two notes as equal if they have the same pitch class. For example, B sharp, C and D double flat should all match.

impl PartialOrd<Note> for Note[src]

impl StructuralEq for Note[src]

impl Sub<u8> for Note[src]

type Output = Self

The resulting type after applying the - operator.

Auto Trait Implementations

impl RefUnwindSafe for Note

impl Send for Note

impl Sync for Note

impl Unpin for Note

impl UnwindSafe for Note

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> ToString for T where
    T: Display + ?Sized
[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.