Skip to main content

IntoNotes

Trait IntoNotes 

Source
pub trait IntoNotes {
    type Notes: IntoIterator<Item = Note>;

    const FROM_INTEGER_PITCHES: bool = false;

    // Required method
    fn try_into_notes(self) -> Result<Self::Notes>;
}
Expand description

Tries to convert a supported chord input into notes.

Implementations are provided for strings, slices, vectors, other chords, integer pitch inputs, and Option<T>. None converts to an empty note list. String and integer inputs can fail while constructing pitches or simplifying enharmonics, so this trait stays explicitly fallible.

Provided Associated Constants§

Source

const FROM_INTEGER_PITCHES: bool = false

Whether this input should be treated as integer-derived pitches.

Required Associated Types§

Source

type Notes: IntoIterator<Item = Note>

Iterator-like collection returned by the conversion.

Required Methods§

Source

fn try_into_notes(self) -> Result<Self::Notes>

Converts the input into notes.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl IntoNotes for &str

Source§

impl IntoNotes for &[&str]

Source§

impl IntoNotes for &[Note]

Source§

impl IntoNotes for &[Pitch]

Source§

impl IntoNotes for &[String]

Source§

impl IntoNotes for &[Chord]

Source§

impl IntoNotes for &[IntegerType]

Source§

impl IntoNotes for String

Source§

impl<T> IntoNotes for Option<T>
where T: IntoNotes,

Source§

const FROM_INTEGER_PITCHES: bool = T::FROM_INTEGER_PITCHES

Source§

type Notes = Vec<Note>

Source§

fn try_into_notes(self) -> Result<Self::Notes>

Source§

impl<T> IntoNotes for Vec<T>
where T: IntoNote,

Source§

const FROM_INTEGER_PITCHES: bool = T::FROM_INTEGER_PITCH

Source§

type Notes = Vec<Note>

Source§

fn try_into_notes(self) -> Result<Self::Notes>

Implementors§