RawChord

Trait RawChord 

Source
pub trait RawChord {
    type Elem;

    // Required methods
    fn as_slice(&self) -> &[Self::Elem];
    fn len(&self) -> usize;

    // Provided method
    fn is_empty(&self) -> bool { ... }
}
Expand description

The RawChord trait works to define a basic interface shared by all compatible reprsentations of a chord. Since a chord is essentially a sequence of pitches, the trait captures this behavior through association with an element type.

Required Associated Types§

Required Methods§

Source

fn as_slice(&self) -> &[Self::Elem]

returns a slice representation of the chord.

Source

fn len(&self) -> usize

returns the number of elements in the chord representation.

Provided Methods§

Source

fn is_empty(&self) -> bool

returns true if the chord contains no elements

Implementations on Foreign Types§

Source§

impl<C, T> RawChord for &C
where C: RawChord<Elem = T>,

Source§

type Elem = T

Source§

fn as_slice(&self) -> &[T]

Source§

fn len(&self) -> usize

Source§

impl<C, T> RawChord for &mut C
where C: RawChord<Elem = T>,

Source§

type Elem = T

Source§

fn as_slice(&self) -> &[T]

Source§

fn len(&self) -> usize

Source§

impl<T> RawChord for &[T]

Source§

type Elem = T

Source§

fn as_slice(&self) -> &[T]

Source§

fn len(&self) -> usize

Source§

impl<T> RawChord for &mut [T]

Source§

type Elem = T

Source§

fn as_slice(&self) -> &[T]

Source§

fn len(&self) -> usize

Source§

impl<T> RawChord for [T]

Source§

type Elem = T

Source§

fn as_slice(&self) -> &[T]

Source§

fn len(&self) -> usize

Source§

impl<T> RawChord for (T, T, T)

Source§

type Elem = T

Source§

fn as_slice(&self) -> &[T]

Source§

fn len(&self) -> usize

Source§

impl<T> RawChord for Vec<T>

Source§

type Elem = T

Source§

fn as_slice(&self) -> &[T]

Source§

fn len(&self) -> usize

Source§

impl<const N: usize, T> RawChord for [T; N]

Source§

type Elem = T

Source§

fn as_slice(&self) -> &[T]

Source§

fn len(&self) -> usize

Implementors§