#[repr(C)]pub struct NoteBase<T, Cls = C> { /* private fields */ }
Expand description
The NoteBase
is a generic representation of a musical note
Implementations§
Source§impl<T, Cls> NoteBase<T, Cls>where
T: RawFrequency,
Cls: PitchClass,
impl<T, Cls> NoteBase<T, Cls>where
T: RawFrequency,
Cls: PitchClass,
pub fn new(pitch: Pitch<T>, octave: Octave) -> Self
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
Sourcepub fn set_octave(&mut self, octave: Octave) -> &mut Self
pub fn set_octave(&mut self, octave: Octave) -> &mut Self
set the octave of the note
Sourcepub fn with_class<Pc: PitchClass>(self) -> NoteBase<T, Pc>
pub fn with_class<Pc: PitchClass>(self) -> NoteBase<T, Pc>
consumes the current instance to create another with the given pitch class
Sourcepub fn with_octave(self, octave: Octave) -> Self
pub fn with_octave(self, octave: Octave) -> Self
consumes the current instance to create another with the given octave
Trait Implementations§
Source§impl<'de, T, Cls> Deserialize<'de> for NoteBase<T, Cls>where
T: Deserialize<'de>,
Cls: Deserialize<'de>,
impl<'de, T, Cls> Deserialize<'de> for NoteBase<T, Cls>where
T: Deserialize<'de>,
Cls: Deserialize<'de>,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<C, T> Display for NoteBase<T, C>where
C: PitchClass,
T: RawFrequency,
impl<C, T> Display for NoteBase<T, C>where
C: PitchClass,
T: RawFrequency,
Source§impl<T: Ord, Cls: Ord> Ord for NoteBase<T, Cls>
impl<T: Ord, Cls: Ord> Ord for NoteBase<T, Cls>
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<T: PartialOrd, Cls: PartialOrd> PartialOrd for NoteBase<T, Cls>
impl<T: PartialOrd, Cls: PartialOrd> PartialOrd for NoteBase<T, Cls>
impl<T: Copy, Cls: Copy> Copy for NoteBase<T, Cls>
impl<T: Eq, Cls: Eq> Eq for NoteBase<T, Cls>
impl<T, Cls> StructuralPartialEq for NoteBase<T, Cls>
Auto Trait Implementations§
impl<T, Cls> Freeze for NoteBase<T, Cls>
impl<T, Cls> RefUnwindSafe for NoteBase<T, Cls>where
Cls: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, Cls> Send for NoteBase<T, Cls>
impl<T, Cls> Sync for NoteBase<T, Cls>
impl<T, Cls> Unpin for NoteBase<T, Cls>
impl<T, Cls> UnwindSafe for NoteBase<T, Cls>where
Cls: UnwindSafe,
T: 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