Struct ukebox::note::Note [−][src]
A note such a C, C# and so on.
Fields
pitch_class: PitchClassImplementations
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.
fn add(self, n: Semitones) -> Self[src]
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.
fn from_str(s: &str) -> Result<Self, Self::Err>[src]
impl Ord for Note[src]
fn cmp(&self, other: &Note) -> Ordering[src]
#[must_use]pub fn max(self, other: Self) -> Self1.21.0[src]
#[must_use]pub fn min(self, other: Self) -> Self1.21.0[src]
#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self1.50.0[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.
#[must_use]pub fn ne(&self, other: &Rhs) -> bool1.0.0[src]
impl PartialOrd<Note> for Note[src]
fn partial_cmp(&self, other: &Note) -> Option<Ordering>[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool1.0.0[src]
impl StructuralEq for Note[src]
impl Sub<u8> 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> 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,
pub 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.
pub fn to_owned(&self) -> T[src]
pub fn clone_into(&self, target: &mut T)[src]
impl<T> ToString for T where
T: Display + ?Sized, [src]
T: Display + ?Sized,
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.
pub 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>,