pub struct Instruments {
    pub instruments: Vec<Instrument>,
}
Expand description

A thin wrapper around a Vec<Instrument> with Add/Subtract operations.

Fields§

§instruments: Vec<Instrument>

A list of instruments.

Implementations§

source§

impl Instruments

source

pub fn all() -> Instruments

All instruments.

source

pub fn piano() -> Instruments

GM1 piano instruments.

source

pub fn tonal_percussive() -> Instruments

GM1 tonal percussive instruments.

source

pub fn organ() -> Instruments

GM1 organ instruments.

source

pub fn guitar() -> Instruments

GM1 guitar instruments.

source

pub fn bass() -> Instruments

GM1 bass instruments.

source

pub fn strings() -> Instruments

GM1 string instruments.

source

pub fn ensemble() -> Instruments

GM1 ensemble instruments.

source

pub fn brass() -> Instruments

GM1 brass instruments.

source

pub fn reed() -> Instruments

GM1 reed instruments.

source

pub fn pipe() -> Instruments

GM1 pipe instruments.

source

pub fn synth_lead() -> Instruments

GM1 synth lead instruments.

source

pub fn synth_pad() -> Instruments

GM1 synth pad instruments.

source

pub fn synth_fx() -> Instruments

GM1 synth FX instruments.

source

pub fn ethnic() -> Instruments

GM1 ethnic instruments.

source

pub fn percussive() -> Instruments

GM1 percussive instruments.

source

pub fn sound_fx() -> Instruments

GM1 sound FX instruments.

source

pub fn melodic() -> Instruments

Returns “melodic” instruments which have a clear tone, and are not overly percussive.

Trait Implementations§

source§

impl Add<Instrument> for Instruments

##Example

let pianos = Instruments { instruments: vec![Instrument::AcousticGrandPiano] }
                        + Instrument::BrightAcousticPiano;
assert_eq!(pianos, Instruments { instruments: vec![Instrument::AcousticGrandPiano, Instrument::BrightAcousticPiano] });
§

type Output = Instruments

The resulting type after applying the + operator.
source§

fn add(self, rhs: Instrument) -> Self::Output

Performs the + operation. Read more
source§

impl Add<Instruments> for Instrument

##Example

let pianos = Instrument::AcousticGrandPiano
                + Instruments { instruments: vec![Instrument::BrightAcousticPiano] };
assert_eq!(pianos, Instruments { instruments: vec![Instrument::AcousticGrandPiano, Instrument::BrightAcousticPiano] });
§

type Output = Instruments

The resulting type after applying the + operator.
source§

fn add(self, rhs: Instruments) -> Self::Output

Performs the + operation. Read more
source§

impl Add for Instruments

##Example

let pianos = Instruments { instruments: vec![Instrument::AcousticGrandPiano] }
                        + Instruments { instruments: vec![Instrument::BrightAcousticPiano] };
assert_eq!(pianos, Instruments { instruments: vec![Instrument::AcousticGrandPiano, Instrument::BrightAcousticPiano] });
§

type Output = Instruments

The resulting type after applying the + operator.
source§

fn add(self, rhs: Self) -> Self::Output

Performs the + operation. Read more
source§

impl Clone for Instruments

source§

fn clone(&self) -> Instruments

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Instruments

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<Instruments> for Vec<Instrument>

##Example

let instruments = Instruments { instruments: vec![Instrument::AcousticGrandPiano, Instrument::BrightAcousticPiano] };
let vec_instruments: Vec<Instrument> = instruments.into();
assert_eq!(
    vec_instruments,
    vec![Instrument::AcousticGrandPiano, Instrument::BrightAcousticPiano]
);
source§

fn from(value: Instruments) -> Self

Converts to this type from the input type.
source§

impl IntoIterator for Instruments

§

type Item = Instrument

The type of the elements being iterated over.
§

type IntoIter = IntoIter<<Instruments as IntoIterator>::Item>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
source§

impl PartialEq for Instruments

source§

fn eq(&self, other: &Instruments) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Sub<Instrument> for Instruments

##Example

let no_violins = Instruments { instruments: vec![Instrument::Violin, Instrument::Cello] }
                        - Instrument::Violin;
assert_eq!(no_violins, Instruments { instruments: vec![Instrument::Cello] });

let instruments = Instruments { instruments: vec![Instrument::AcousticGrandPiano, Instrument::BrightAcousticPiano] };
§

type Output = Instruments

The resulting type after applying the - operator.
source§

fn sub(self, rhs: Instrument) -> Self::Output

Performs the - operation. Read more
source§

impl Sub for Instruments

##Example

let no_violins = Instruments { instruments: vec![Instrument::Violin, Instrument::Cello] }
                        - Instruments { instruments: vec![Instrument::Violin] };
assert_eq!(no_violins, Instruments { instruments: vec![Instrument::Cello] });
§

type Output = Instruments

The resulting type after applying the - operator.
source§

fn sub(self, rhs: Self) -> Self::Output

Performs the - operation. Read more
source§

impl StructuralPartialEq for Instruments

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V