Enum music_theory::theory::interval::NamedOctaveInterval
source · pub enum NamedOctaveInterval {
Root,
Min2,
Maj2,
Min3,
Maj3,
Per4,
Trit,
Per5,
Min6,
Maj6,
Min7,
Maj7,
}
Expand description
An interval within the octave with a distinct name.
Variants§
Root
The root interval is an interval of zero.
Min2
Minor second interval.
Maj2
Major second interval.
Min3
Minor third interval.
Maj3
Major third interval.
Per4
Perfect fourth interval.
Trit
Tritone interval.
Per5
Perfect fifth interval.
Min6
Minor sixth interval.
Maj6
Major sixth interval.
Min7
Minor seventh interval.
Maj7
Major seventh interval.
Implementations§
source§impl NamedOctaveInterval
impl NamedOctaveInterval
sourcepub const ALL: [Self; 12] = _
pub const ALL: [Self; 12] = _
All named octave intervals so you iterate over them.
Example:
use music_theory::theory::*;
assert_eq!(NamedOctaveInterval::ALL.iter().copied().next(), Some(NamedOctaveInterval::Root));
Trait Implementations§
source§impl Clone for NamedOctaveInterval
impl Clone for NamedOctaveInterval
source§fn clone(&self) -> NamedOctaveInterval
fn clone(&self) -> NamedOctaveInterval
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Cyclic for NamedOctaveInterval
impl Cyclic for NamedOctaveInterval
source§impl Debug for NamedOctaveInterval
impl Debug for NamedOctaveInterval
source§impl Display for NamedOctaveInterval
impl Display for NamedOctaveInterval
source§impl Hash for NamedOctaveInterval
impl Hash for NamedOctaveInterval
source§impl Ord for NamedOctaveInterval
impl Ord for NamedOctaveInterval
source§fn cmp(&self, other: &NamedOctaveInterval) -> Ordering
fn cmp(&self, other: &NamedOctaveInterval) -> Ordering
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 PartialEq<NamedOctaveInterval> for NamedOctaveInterval
impl PartialEq<NamedOctaveInterval> for NamedOctaveInterval
source§fn eq(&self, other: &NamedOctaveInterval) -> bool
fn eq(&self, other: &NamedOctaveInterval) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd<NamedOctaveInterval> for NamedOctaveInterval
impl PartialOrd<NamedOctaveInterval> for NamedOctaveInterval
source§fn partial_cmp(&self, other: &NamedOctaveInterval) -> Option<Ordering>
fn partial_cmp(&self, other: &NamedOctaveInterval) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl ToInterval for NamedOctaveInterval
impl ToInterval for NamedOctaveInterval
source§fn to_interval(self) -> Interval
fn to_interval(self) -> Interval
Take self and return Interval.
impl Copy for NamedOctaveInterval
impl Eq for NamedOctaveInterval
impl StructuralEq for NamedOctaveInterval
impl StructuralPartialEq for NamedOctaveInterval
Auto Trait Implementations§
impl RefUnwindSafe for NamedOctaveInterval
impl Send for NamedOctaveInterval
impl Sync for NamedOctaveInterval
impl Unpin for NamedOctaveInterval
impl UnwindSafe for NamedOctaveInterval
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> ToNamedInterval for Twhere
T: ToInterval,
impl<T> ToNamedInterval for Twhere T: ToInterval,
source§fn to_named_interval_try(self) -> Option<NamedInterval>
fn to_named_interval_try(self) -> Option<NamedInterval>
Try to convert to NamedInterval.
source§fn to_named_interval_mod(self) -> NamedInterval
fn to_named_interval_mod(self) -> NamedInterval
Convert to NamedInterval with wrapping around the octaves.
source§impl<T> ToNamedOctaveInterval for Twhere
T: ToInterval,
impl<T> ToNamedOctaveInterval for Twhere T: ToInterval,
source§fn to_named_octave_interval_try(self) -> Option<NamedOctaveInterval>
fn to_named_octave_interval_try(self) -> Option<NamedOctaveInterval>
Try to convert to NamedOctaveInterval.
source§fn to_named_octave_interval_mod(self) -> NamedOctaveInterval
fn to_named_octave_interval_mod(self) -> NamedOctaveInterval
Convert to NamedOctaveInterval with wrapping around the octave.