pub struct Note { /* private fields */ }Implementations§
Source§impl Note
impl Note
pub fn new(class: usize, Octave: Octave) -> Self
Sourcepub fn from_pitch(pitch: usize) -> Self
pub fn from_pitch(pitch: usize) -> Self
returns a new note from a pitch value
Sourcepub fn class_mut(&mut self) -> &mut usize
pub fn class_mut(&mut self) -> &mut usize
returns a mutable reference to the index of the note’s class
Sourcepub fn octave_mut(&mut self) -> &mut Octave
pub fn octave_mut(&mut self) -> &mut Octave
returns a mutable reference to the current octave
Sourcepub fn set_octave(&mut self, octave: Octave)
pub fn set_octave(&mut self, octave: Octave)
set the octave of the note
Sourcepub fn with_class(self, class: usize) -> Self
pub fn with_class(self, class: usize) -> Self
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 AddAssign<usize> for Note
impl AddAssign<usize> for Note
Source§fn add_assign(&mut self, rhs: usize)
fn add_assign(&mut self, rhs: usize)
Performs the
+= operation. Read moreSource§impl AddAssign for Note
impl AddAssign for Note
Source§fn add_assign(&mut self, rhs: Note)
fn add_assign(&mut self, rhs: Note)
Performs the
+= operation. Read moreSource§impl Ord for Note
impl Ord for Note
Source§impl PartialOrd for Note
impl PartialOrd for Note
Source§impl SubAssign<usize> for Note
impl SubAssign<usize> for Note
Source§fn sub_assign(&mut self, rhs: usize)
fn sub_assign(&mut self, rhs: usize)
Performs the
-= operation. Read moreimpl Copy for Note
impl Eq for Note
impl StructuralPartialEq for Note
Auto Trait Implementations§
impl Freeze for Note
impl RefUnwindSafe for Note
impl Send for Note
impl Sync for Note
impl Unpin for Note
impl UnwindSafe for Note
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more