Struct ukebox::note::Note [−][src]
pub struct Note { pub pitch_class: PitchClass, // some fields omitted }
Expand description
A note such a C, C# and so on.
Fields
pitch_class: PitchClass
Implementations
impl Note
[src]
impl Note
[src]pub fn new(pitch_class: PitchClass, staff_position: StaffPosition) -> Self
[src]
pub fn is_white_note(&self) -> bool
[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 From<PitchClass> for Note
[src]
impl From<PitchClass> for Note
[src]fn from(pitch_class: PitchClass) -> Self
[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 Ord for Note
[src]
impl Ord for Note
[src]impl PartialOrd<Note> for Note
[src]
impl PartialOrd<Note> for Note
[src]fn partial_cmp(&self, other: &Note) -> Option<Ordering>
[src]
fn partial_cmp(&self, other: &Note) -> Option<Ordering>
[src]This method returns an ordering between self
and other
values if one exists. Read more
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than (for self
and other
) and is used by the <
operator. Read more
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl Copy for Note
[src]
impl Eq for Note
[src]
impl StructuralEq for Note
[src]
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> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]pub fn equivalent(&self, key: &K) -> bool
[src]
pub fn equivalent(&self, key: &K) -> bool
[src]Compare self to key
and return true
if they are equal.
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more