pub trait HasEnharmonicDistance {
// Required method
fn enharmonic_distance(&self) -> i8;
}Expand description
A trait for types that have an enharmonic distance.
Required Methods§
Sourcefn enharmonic_distance(&self) -> i8
fn enharmonic_distance(&self) -> i8
Returns the enharmonic distance of the type (most likely an interval).
Due to the nature of enharmonic intervals, the distance is always an integer, and it looks a bit funky. Basically, using the circle of fifths, the distance is the number of fifths between the two notes. For example, a perfect fifth is 1 fifth away, and a major second is always two fifths away (look at the implementation). This preserves enharmonic correctness.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".