pub struct NoteBase<P = CNote, K = <P as RawPitchClass>::Tag>where
P: RawPitchClass<Tag = K>,
K: RawAccidental,{ /* private fields */ }Expand description
The NoteBase is a generic representation of a musical note
Implementations§
Source§impl<P, K> NoteBase<P, K>where
P: RawPitchClass<Tag = K>,
K: RawAccidental,
impl<P, K> NoteBase<P, K>where
P: RawPitchClass<Tag = K>,
K: RawAccidental,
Sourcepub const fn new(class: PitchClass<P, K>, octave: Octave) -> Self
pub const fn new(class: PitchClass<P, K>, octave: Octave) -> Self
constructs a new NoteBase instance
Sourcepub fn from_octave(octave: Octave) -> Selfwhere
P: PitchClassRepr,
K: Accidental,
pub fn from_octave(octave: Octave) -> Selfwhere
P: PitchClassRepr,
K: Accidental,
initialize a new instance of the note from the given octave
Sourcepub const fn class(&self) -> &PitchClass<P, K>
pub const fn class(&self) -> &PitchClass<P, K>
returns a reference to the current class
Sourcepub const fn class_mut(&mut self) -> &mut PitchClass<P, K>
pub const fn class_mut(&mut self) -> &mut PitchClass<P, K>
returns a mutable reference to the current class
Sourcepub const fn octave_mut(&mut self) -> &mut Octave
pub const fn octave_mut(&mut self) -> &mut Octave
returns a mutable reference to the current octave
Source§impl<P> NoteBase<P>where
P: RawPitchClass,
impl<P> NoteBase<P>where
P: RawPitchClass,
Sourcepub fn natural(class: P, octave: Octave) -> NoteBase<P, Natural>where
P: RawPitchClass<Tag = Natural>,
pub fn natural(class: P, octave: Octave) -> NoteBase<P, Natural>where
P: RawPitchClass<Tag = Natural>,
returns a new natural note of the given class and octave
Trait Implementations§
Source§impl<P, K> Debug for NoteBase<P, K>where
P: RawPitchClass<Tag = K>,
K: RawAccidental,
impl<P, K> Debug for NoteBase<P, K>where
P: RawPitchClass<Tag = K>,
K: RawAccidental,
Source§impl<P, K> Display for NoteBase<P, K>where
P: RawPitchClass<Tag = K>,
K: RawAccidental,
impl<P, K> Display for NoteBase<P, K>where
P: RawPitchClass<Tag = K>,
K: RawAccidental,
Source§impl<P, K> Ord for NoteBase<P, K>
impl<P, K> Ord for NoteBase<P, K>
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<P, K> PartialEq<&str> for NoteBase<P, K>where
P: RawPitchClass<Tag = K>,
K: RawAccidental,
impl<P, K> PartialEq<&str> for NoteBase<P, K>where
P: RawPitchClass<Tag = K>,
K: RawAccidental,
Source§impl<P, K> PartialEq<str> for NoteBase<P, K>where
P: RawPitchClass<Tag = K>,
K: RawAccidental,
impl<P, K> PartialEq<str> for NoteBase<P, K>where
P: RawPitchClass<Tag = K>,
K: RawAccidental,
Source§impl<P, K> PartialOrd for NoteBase<P, K>
impl<P, K> PartialOrd for NoteBase<P, K>
impl<P, K> Copy for NoteBase<P, K>
impl<P, K> Eq for NoteBase<P, K>
impl<P, K> StructuralPartialEq for NoteBase<P, K>where
P: RawPitchClass<Tag = K>,
K: RawAccidental,
Auto Trait Implementations§
impl<P, K> Freeze for NoteBase<P, K>
impl<P, K> RefUnwindSafe for NoteBase<P, K>where
P: RefUnwindSafe,
K: RefUnwindSafe,
impl<P, K> Send for NoteBase<P, K>
impl<P, K> Sync for NoteBase<P, K>
impl<P, K> Unpin for NoteBase<P, K>
impl<P, K> UnwindSafe for NoteBase<P, K>where
P: UnwindSafe,
K: UnwindSafe,
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